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
0
1k
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
Tweet
Share
More Decks by cnu
See All by cnu
Redisconf 2018: Probabilistic Data Structures
cnu
1
970
Probabilistic Data Structures
cnu
0
640
AWS Lambda - Pycon India 2016
cnu
0
510
ZeroMQ - PyCon India 2013
cnu
2
1.5k
Other Decks in Programming
See All in Programming
CLI ツールを Go ライブラリ として再実装する理由 / Why reimplement a CLI tool as a Go library
ktr_0731
3
960
Terraform やるなら公式スタイルガイドを読もう 〜重要項目 10選〜
hiyanger
12
2.9k
11年かかって やっとVibe Codingに 時代が追いつきましたね
yimajo
1
240
Workers を定期実行する方法は一つじゃない
rokuosan
0
140
大規模FlutterプロジェクトのCI実行時間を約8割削減した話
teamlab
PRO
0
450
kiroでゲームを作ってみた
iriikeita
0
140
マイコンでもRustのtestがしたい その2/KernelVM Tokyo 18
tnishinaga
0
150
可変性を制する設計: 構造と振る舞いから考える概念モデリングとその実装
a_suenami
10
1.6k
DatadogのArchived LogsをSnowflakeで高速に検索する方法(Archive Searchでオワコンにならないことを祈って) / How to search Datadog Archived Logs quickly with Snowflake (hoping Datadog Archive Search doesn’t make this obsolete)
civitaspo
0
110
AIコーディングエージェント全社導入とセキュリティ対策
hikaruegashira
16
9.4k
リッチエディターを安全に開発・運用するために
unachang113
1
350
Flutterと Vibe Coding で個人開発!
hyshu
1
230
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
750
Automating Front-end Workflow
addyosmani
1370
200k
What's in a price? How to price your products and services
michaelherold
246
12k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.2k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Become a Pro
speakerdeck
PRO
29
5.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.5k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.5k
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