Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TECHPULSE 2019 - LINE SPOT and How We Build It

TECHPULSE 2019 - LINE SPOT and How We Build It

By Julian Shen @LINE TECHPULSE 2019 https://techpulse.line.me/

LINE Developers Taiwan

December 04, 2019
Tweet

More Decks by LINE Developers Taiwan

Other Decks in Programming

Transcript

  1. Find On Map and paste it back to chatroom Texts

    With a Very Small Image Julian
  2. You May Also Want To Know what other people says

    on the Internet Julian Search Julian Texts With a Very Small Image
  3. You May Also Want To Know Any discount? Any promotion?

    Julian Julian LINEꃏⵚ FunNow LINE翝㣔㹔
  4. It’s a Long Journey and many tools involved LINE Map

    Search LINE TODAY LINE 蠐ڭ FunNow Phone Call 肾肾 LINE Taxi Discover Reserve Transport Discuss
  5. Challenges with building LINE SPOT Shipping Features More Frequently Need

    To Be Able To Support High Traffic Many Different Services Needed To Be Integrated
  6. We Decide To Build With Microservices GraphQL Vue.Js LINE Flex

    Message Event Sourcing Messaging API Kafka Kubernetes
  7. Microservices Architecture Suite of small and loosely coupled services (Loose

    Coupling) Each service encapsulates all related logic and data (High Cohesion) Each service serve single purpose (Single Purpose)
  8. Monolithic Microservices DB Data Access Layer Business Logic User Interface

    DB DB DB User Interface Order Service Customer Service Product Interface Cart Service
  9. Why We Adopted Microservices Advantage of Microservices Flexibility of Development

    > Easy to add new components > Easy to replace with new implementation > Right technology for the job > Deploy independently > Scale independently > Easy to isolate and find problems Easy To Maintain
  10. Challenges Come With Microservices Disadvantage of Microservices More complexity in

    connectivity More complexity in operation More complexity in data integration
  11. Frontend and Microservices User Interface Too Many Interfaces To Communicate

    Service 1 Service 2 Service 3 Service 4 Thrift Thrift Thrift
  12. Frontend and Microservices User Interface Service 1 Service 2 Service

    3 Service 4 API Gateway Thrift Thrift Thrift Thrift Thrift Thrift Thrift GraphQL Ask What You Need, Get Exactly That Get Many Resources in a Single Request
  13. Example of GraphQL { hero { name # Queries can

    have comments! friends { name } } } { "data": { "hero": { "name": "R2-D2", "friends": [ { "name": "Luke Skywalker" }, { "name": "Han Solo" }, { "name": "Leia Organa" } ] } }\
  14. Challenges of Data Integration Schema might need to be changed

    when add new services Data might be in several databases Data aggregation at runtime is inefficient Various data sources from partners
  15. Data Integration Coupon List POI Search POI Detail Recommendation Store

    Management Data Presentation POI LINE OA OA Coupon Partner (Reservation) Partner (Vocher) Partner (Ticket)
  16. Traditional CRUD POI Coupon Voucher Store Detail Join Tables At

    Runtime POI Coupon Voucher Store Service Coupon Service Voucher Service Store Detail
  17. Event Sourcing Handler 1 Handler 2 View 1 View 2

    View 3 View 4 Service 1 Service 2 Service 3 Service 4 View Service Event Handler Events POI Create POI Delete POI Create POI Update Add New Product Update Product Delete Product Add New Product Add New Service Service
 Scope
 Change Add New Service Service
 Scope
 Change
  18. Challenges in Operations > Different configurations for different env (beta,

    staging, production) > Kafka connector configurations Configurations Resources > How to use resources efficiently Lot of Services & Containers > More complexity in deployment > Service discovery could be complicated
  19. Beta Deployment With Kubernetes GitHub Drone CI Docker Registry Kubectl

    Kubernetes Code Changes Commit Build Publish Deploy
  20. Deploy Kafka Connector Configurations GitHub Drone CI Kafka Connect Config

    Changes Commit Build REST API > Deployment is apart from Deployment to Kubernetes cluster > Hard to manage dependencies
  21. Kafka Connector as K8S Resource GitHub Drone CI Kubectl Kustomize

    Configuration Changes Commit Build Kustomize Kafka Connect Operator Kubernetes Kafka Connect REST API
  22. LINE SPOT Architecture MySQL ElasticSearch Kafka Streams Kafka Connect Locator

    Suggester Partners Ticket Registration {Rest Api} GraphQL Used by CMS Material View Kubernetes Cluster API Gateway Partner API Browser