@ksshams @swami_79
NoSQL like There is No Tomorrow
Swaminathan Sivasubramanian
GM, NoSQL
Khawaja
Head of Engineering, NoSQL
Swami
NoSQL like There is No Tomorrow Khawaja Head of Engineering, NoSQL - - PowerPoint PPT Presentation
NoSQL like There is No Tomorrow Khawaja Head of Engineering, NoSQL Swaminathan Sivasubramanian Swami GM, NoSQL @swami_79 @ksshams how can you build your own DynamoDB Scale service? @swami_79 @ksshams lets start with a story about a
@ksshams @swami_79
Swaminathan Sivasubramanian
GM, NoSQL
Khawaja
Head of Engineering, NoSQL
Swami
@ksshams @swami_79
how can you build your own DynamoDB Scale service?
@ksshams @swami_79
@ksshams @swami_79
@ksshams @swami_79
a few thousand miles away... (seattle)
@ksshams @swami_79
amazon.com - a rapidly growing Internet based retail business relied on relational databases
@ksshams @swami_79
we had 1000s of independent services
@ksshams @swami_79
each service managed its state in RDBMs
@ksshams @swami_79
@ksshams @swami_79
@ksshams @swami_79
@ksshams @swami_79
@ksshams @swami_79
as versatile as a swiss army knife
complex queries
key-value access transactions analytics
@ksshams @swami_79
RDBMs are too similar to Swiss Army Knives
@ksshams @swami_79
but sometimes.. swiss army knifes.. can be more than what you bargained for
@ksshams @swami_79
partitioning
@ksshams @swami_79
so we bought
bigger boxes...
@ksshams @swami_79
benchmark new hardware migrate to new hardware repartition databases pray ...
@ksshams @swami_79
@ksshams @swami_79
@ksshams @swami_79
predecessor to dynamoDB
specialist tool :
replicated DHT with consistent hashing
“sloppy quorum” anti-entropy mechanism
@ksshams @swami_79
@ksshams @swami_79
lacked strong consistency
@ksshams @swami_79
scaling was easier, but...
@ksshams @swami_79
steep learning curve
@ksshams @swami_79
dynamo was a product ... ==>> not a service...
@ksshams @swami_79
@ksshams @swami_79
“Even though we have years of experience with large, complex NoSQL architectures, we are happy to be finally out of the business of managing it ourselves.” - Don MacAskill, CEO
@ksshams @swami_79
@ksshams @swami_79
amazon.com’s experience with services
@ksshams @swami_79
how do you create a successful service?
@ksshams @swami_79
with great services, comes great responsibility
@ksshams @swami_79
never compromise on durability
scale is our problem easy to use
scale in rps consistent and low latencies
@ksshams @swami_79
Architect Test Monitor Goals D e p l
Develop
Customer
@ksshams @swami_79
Architect
Monitor Goals
Customer
Deploy Develop
@ksshams @swami_79
plan for success - plan for scalability don’t compromise durability for performance
plan for failures - fault -tolerance is key
consistent performance is important design - think of blast radius insist on correctness
@ksshams @swami_79
fault tolerance is a lesson best learned offline
@ksshams @swami_79
a simple 2-way replication system of a traditional database…
Primary Standby
Writes
@ksshams @swami_79
@ksshams @swami_79
P S
S ¡is ¡dead, ¡need ¡ to ¡trigger ¡new ¡ replica P ¡is ¡dead, ¡need ¡to ¡ promote ¡myself
P’
@ksshams @swami_79
@ksshams @swami_79
improved Replication: quorum
Replica Replica
Writes
Replica
Quorum: Successful write on a majority
Not so easy..
Replica B Replica C
Writes from client A
Replica A Replica D
New member in the group Should I continue to serve reads? Should I start a new quorum?
Replica E Replica F
Reads and Writes from client B Classic Split Brain Issue in Replicated systems leading to lost writes!
@ksshams @swami_79
Building correct distributed systems is not straight forward..
quorum?
to minimize bugs, we must have a precise description of the design
code is too detailed how would you express partial failures or concurrency? design documents and diagrams are vague & imprecise
@ksshams @swami_79
@ksshams @swami_79
@ksshams @swami_79
@ksshams @swami_79
A r c h i t e c t
M
i t
Goals
customer
Deploy D e v e l
@ksshams @swami_79
simulate failures at unit test level
fault injection testing
datacenter testing
scale testing
@ksshams @swami_79
@ksshams @swami_79
Architect Test Monitor G
l s
Customer
Deploy D e v e l
@ksshams @swami_79
gamma simulate real world
does it work? phased deployment treading lightly monitor does it still work?
@ksshams @swami_79
Canaries
@ksshams @swami_79
Alarms
@ksshams @swami_79
Monitor customer behavior
Architect T e s t
Monitor
G
l s
Customer
Deploy Develop
@ksshams @swami_79
measuring customer experience is key
don’t be satisfied by average - look at 99 percentile
@ksshams @swami_79
@ksshams @swami_79
@ksshams @swami_79
let’s see these rules in action through a true story
@ksshams @swami_79
we were building distributed systems all over amazon.com
@ksshams @swami_79
we needed a uniform and correct way to do consensus..
@ksshams @swami_79
so we built a paxos lock library service
@ksshams @swami_79
such a service is so much more useful than just leader election.. it became a distributed state store
@ksshams @swami_79
such a service is so much more useful than just leader election..
wait wait.. you’re telling me if I poll, I can detect node failure?
@ksshams @swami_79
we acted quickly - and scaled up our entire fleet with more nodes
doh!!!!
@ksshams @swami_79
@ksshams @swami_79
L e a d e r E l e c t i
Failure Notification
State Store
@ksshams @swami_79
L e a d e r E l e c t i
F a i l u r e N
i f i c a t i
State Store
@ksshams @swami_79
L e a d e r E l e c t i
F a i l u r e N
i f i c a t i
State Store
@ksshams @swami_79
L e a d e r E l e c t i
F a i l u r e N
i f i c a t i
State Store
@ksshams @swami_79
understand scaling dimensions
how service is used
strive for correctness relentlessly test monitor like a hawk
@ksshams @swami_79
Thank You!