Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Rocky Road from Monolithic to Microservice...
Search
cnu
November 25, 2017
Programming
1.2k
0
Share
The Rocky Road from Monolithic to Microservices Architecture
The explanation of our Microservices architecture and the lessons we learnt from it.
cnu
November 25, 2017
More Decks by cnu
See All by cnu
Redisconf 2018: Probabilistic Data Structures
cnu
1
1.1k
Probabilistic Data Structures
cnu
0
720
AWS Lambda - Pycon India 2016
cnu
0
590
ZeroMQ - PyCon India 2013
cnu
2
1.6k
Other Decks in Programming
See All in Programming
GoogleCloudとterraform完全に理解した
terisuke
1
160
PHPer、Cloudflare に引っ越す
suguruooki
1
110
第3木曜LT会 #28
tinykitten
PRO
0
120
NakouPAY説明用
annouim0
0
270
Making the RBS Parser Faster
soutaro
0
570
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
800
Explore CoroutineScope
tomoeng11
0
110
Kingdom of the Machine
yui_knk
2
1.1k
CDK Deployのための ”反響定位”
watany
5
890
Server-Side Kotlin LT大会 vol.18 [Kotlin-lspの最新情報と Neovimのlsp設定例]
yasunori0418
1
200
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
250
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
290
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
380
Utilizing Notion as your number one productivity tool
mfonobong
4
290
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.2k
We Have a Design System, Now What?
morganepeng
55
8.1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
780
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
530
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
120
Transcript
THE ROCKY ROAD FROM MONOLITHIC TO MICROSERVICES ARCHITECTURE
THE ROCKY ROAD FROM MONOLITHIC TO MICROSERVICES ARCHITECTURE
SRINIVASAN RANGARAJAN Head of Product Engineering
SRINIVASAN RANGARAJAN https://cnu.name Twitter: @cnu Github: @cnu
RETAIL AUTOMATION PRODUCT
Catalog & User Events Processing Recommendation
MONOLITHIC ARCHITECTURE
MONOLITHIC ARCHITECTURE Image Processing API Image Searcher File Storage
MINIMUM TWO SERVERS BEHIND ELB Load Balancer
CLOUD VS BARE METAL
EXPENSIVE
NOT REALTIME
NOT PERSONALIZABLE
API Data Store Ingestion Image Processing Image Searcher User Event
Personalization Engine
GOTHAM
API Data Store Ingestion Image Processing Image Searcher User Event
Personalization Engine
JOKER • Convert client’s catalog into one common MAD Format
• Normalization of fields and metadata • Can process batch and streaming data • Major cause of chaos in the system
GORDON • Routes the product metadata to the right micro
services • Is it a new product? or update to an existing product? • Streaming data from AWS SQS
WONDER WOMAN • Not a microservice, But a tool used
to generate rules for the catalog • Rules are send to the Image Processing microservice • Works on Samples of data and not entire dataset
WATCHTOWER • Central Source of Truth for all metadata •
Backed by an RDBMS Database (Postgresql) • Input via SQS and REST API • Output via REST API
INGESTION Gordon Joker Joker Joker Wonder Woman Watchtower Next Stage
API Data Store Ingestion Image Processing Image Searcher User Event
Personalization Engine
NIGHTWING • Computer Vision and Deep Learning Models • Convert
Image to high dimensional vectors • Tag image with visual attributes • Computer Intensive
API Data Store Ingestion Image Processing Image Searcher User Event
Personalization Engine
BATMAN • Custom very fast Vector Indexer and Search Engine
• Stores everything in memory • Two sub-parts: Indexer and Searcher • Store binary information about image in DynamoDB
API Data Store Ingestion Image Processing Image Searcher User Event
Personalization Engine
SUPERMAN • User behaviour based recommendation • Multiple products like
Collaborative filtering, Cross Product recommendation • Records every user event data and stores in a data warehouse
TWO FACE • Individual User level Personalization • Shows a
different “face” to each user • Dynamic and realtime
API Data Store Ingestion Image Processing Image Searcher User Event
Personalization Engine
FLASH • Very fast data structure storage - redis instance
• User session level history, Product Availability, etc. • Fast access, but non- expirable
GCPD • “Global Cache for Products Digested” • Rough first
level of cache for the results
API Data Store Ingestion Image Processing Image Searcher User Event
Personalization Engine
ROBIN • API Gateway for all our products • Combines
data from other micro services like Batman, Two Face, Watchtower, Superman, etc and returns JSON Response
API Data Store Ingestion Image Processing Image Searcher User Event
Personalization Engine Joker, Gordon, Wonder Woman Nightwing Batman Robin Watchtower, GCPD, Flash Superman, Two Face
LESSONS WE LEARNT
START WITH A MONOLITH. CHIP OFF PIECES AND BUILD THE
MICROSERVICES. Lesson 0
–Melvin Conway “… organizations which design systems ... are constrained
to produce designs which are copies of the communication structures of these organizations."
DEPLOY HETEROGENOUS MICROSERVICES IN A SINGLE SERVER Lesson 1
Compute Optimized Server Memory Optimized Server Nightwing Batman Robin Robin
Robin Joker Joker Joker Gordon Watch tower Watch tower Joker
IMMUTABLE MICROSERVICES Lesson 2
Constable Inspector Assistant Commissioner Commissioner
ASYNCHRONOUS IS BETTER THAN SYNCHRONOUS Lesson 3
None
NOT ALL MICROSERVICES NEED TO BE SERVERS Lesson 4
ADD REQUEST ID OR TRANSACTION ID TO DEBUG EASILY Lesson
5
GIVE A CHARACTER TO YOUR MICROSERVICES Lesson 6
None
THANK YOU
http://cnu.name/talks/ @cnu