Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

LINE SPOT AND HOW WE BUILD IT > Julian Shen / LINE SPOT Development

Slide 3

Slide 3 text

What is LINE SPOT? Let’s start from a simple scenario

Slide 4

Slide 4 text

Imagine This Julian

Slide 5

Slide 5 text

What Would You Do?

Slide 6

Slide 6 text

Find On Map and paste it back to chatroom Texts With a Very Small Image Julian

Slide 7

Slide 7 text

You May Also Want To Know what other people says on the Internet Julian Search Julian Texts With a Very Small Image

Slide 8

Slide 8 text

You May Also Want To Know Any discount? Any promotion? Julian Julian LINEꃏⵚ FunNow LINE翝㣔㹔

Slide 9

Slide 9 text

Make a Reservation How you make a reservation? Via phone? Online? Julian

Slide 10

Slide 10 text

Need a Ride? Julian Call LINE Taxi!!

Slide 11

Slide 11 text

It’s a Long Journey and many tools involved LINE Map Search LINE TODAY LINE 蠐ڭ FunNow Phone Call 肾肾 LINE Taxi Discover Reserve Transport Discuss

Slide 12

Slide 12 text

Put It All Together Stores Articles Comments & Ratings Promotions Reservation Transportation

Slide 13

Slide 13 text

蝫娄䄓ݪ੻ Life On LINE SPOT Making it easier Julian Julian BizCard

Slide 14

Slide 14 text

LINE SPOT Is LINE Near by O2O Services

Slide 15

Slide 15 text

Challenges with building LINE SPOT Shipping Features More Frequently Need To Be Able To Support High Traffic Many Different Services Needed To Be Integrated

Slide 16

Slide 16 text

We Decide To Build With Microservices GraphQL Vue.Js LINE Flex Message Event Sourcing Messaging API Kafka Kubernetes

Slide 17

Slide 17 text

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)

Slide 18

Slide 18 text

Monolithic Microservices DB Data Access Layer Business Logic User Interface DB DB DB User Interface Order Service Customer Service Product Interface Cart Service

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

Challenges Come With Microservices Disadvantage of Microservices More complexity in connectivity More complexity in operation More complexity in data integration

Slide 21

Slide 21 text

Frontend and Microservices User Interface Too Many Interfaces To Communicate Service 1 Service 2 Service 3 Service 4 Thrift Thrift Thrift

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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" } ] } }\

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

Data Integration Coupon List POI Search POI Detail Recommendation Store Management Data Presentation POI LINE OA OA Coupon Partner (Reservation) Partner (Vocher) Partner (Ticket)

Slide 26

Slide 26 text

Traditional CRUD POI Coupon Voucher Store Detail Join Tables At Runtime POI Coupon Voucher Store Service Coupon Service Voucher Service Store Detail

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

Deployment With Kubernetes Kustomize Configuration Changes GitHub Drone CI Docker Registry Kubectl Kubernetes Commit Build Kustomize

Slide 30

Slide 30 text

Beta Deployment With Kubernetes GitHub Drone CI Docker Registry Kubectl Kubernetes Code Changes Commit Build Publish Deploy

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

Kafka Connector as K8S Resource GitHub Drone CI Kubectl Kustomize Configuration Changes Commit Build Kustomize Kafka Connect Operator Kubernetes Kafka Connect REST API

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

Tech Stacks We Used To Build LINE SPOT

Slide 35

Slide 35 text

Thank You