Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
- KIRAN NARASAREDDY
CO-FOUNDER, DIRECTOR TECHNOLOGY
@AMURATECH
BUILDING FOR SCALE
95M+
DOCUMENTS
2.5M+
DAILY
TRANSACTIONS
AUDITION YOUR MODELS!
AUDITION YOUR MODELS!
OPTIMISE YOUR SCHEMA FOR MOST
FREQUENT USE CASES
AUDITION YOUR MODELS!
LARGE NUMBER OF COLLECTIONS
AUDITION YOUR MODELS!
DO STI FOR THE RIGHT REASONS
AUDITION YOUR MODELS!
KEEP AN EYE ON DOCUMENTS SIZE
ITS OKAY NOT TO BE
NORMALISED)
ITS OKAY NOT TO BE
NORMALISED)
ITS OKAY NOT TO BE
NORMALISED
DO JOINS ON WRITE, NOT ON READ.
ITS OKAY NOT TO BE
NORMALISED
DON'T FEAR TO EMBED YOUR KID.
BUT..
SOMETIMES, ITS OKAY TO BE
NORMALISED TOO!
READ PERFORMANCE VS DATA DUPLICATION
SOMETIMES, ITS OKAY TO BE
NORMALISED TOO!
COMPLEX MODELLING / HIERARCHY
GET YOUR
PRIORITIES RIGHT!
MONGODB <= 2.4 / MONGOID < 4.1
MONGODB >= 2.6 / MONGOID >= 4.1
PLEASE EXPLAIN!
PLEASE EXPLAIN!
User
.where(email:"***")
.where(phone:"***")
PLEASE EXPLAIN!
User
.where(email:"***")
.where(phone:"***")
.explain()
PLEASE EXPLAIN!
OMIT FIELDS IF FILTRATION< 90%
PLEASE EXPLAIN!
COVER YOUR QUERIES
(SIDE)KIQ'D
(SIDE)KIQ'D
SIDEKIQ'D
SIDEKIQ'D
SIDEKIQ'D
SIDEKIQ'D
LOAD BALANCER... CAUSE WE ARE LAZY!
SIDEKIQ'D
‣ MANAGE LATENCY
‣ WORKER LOAD
MAY THE FORCE BE WITH YOU
KIRAN NARASAREDDY
http://kco.re / @_kcore
Building for Scale!
Building for Scale!
Building for Scale!
Building for Scale!
Building for Scale!
Building for Scale!
Building for Scale!
Building for Scale!
Upcoming SlideShare
Loading in …5
×

Building for Scale!

220 views

Published on

We all know it doesn’t take much to code up a simple application in Rails with mongo. But what happens when your app is a hit with your users? Simple things which were working just fine start behaving weirdly and the next thing you know your app is sluggish, crashing every few hours when the load spikes. This talk is a summary of all the things that i have encountered while taking our product from 0 to 5000+ users handling more than a million transactions on a daily basis. It covers simple rails patterns that scale, ones that fail, design patterns and system architecture that will help have a peaceful sleep at nights, designing your datastore for scale, better background processing with sidekiq, monitoring. Attendees can learn about all the ways their can fail so that they plan ahead for them.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Building for Scale!

  1. 1. - KIRAN NARASAREDDY CO-FOUNDER, DIRECTOR TECHNOLOGY @AMURATECH BUILDING FOR SCALE
  2. 2. 95M+ DOCUMENTS 2.5M+ DAILY TRANSACTIONS
  3. 3. AUDITION YOUR MODELS!
  4. 4. AUDITION YOUR MODELS! OPTIMISE YOUR SCHEMA FOR MOST FREQUENT USE CASES
  5. 5. AUDITION YOUR MODELS! LARGE NUMBER OF COLLECTIONS
  6. 6. AUDITION YOUR MODELS! DO STI FOR THE RIGHT REASONS
  7. 7. AUDITION YOUR MODELS! KEEP AN EYE ON DOCUMENTS SIZE
  8. 8. ITS OKAY NOT TO BE NORMALISED)
  9. 9. ITS OKAY NOT TO BE NORMALISED)
  10. 10. ITS OKAY NOT TO BE NORMALISED DO JOINS ON WRITE, NOT ON READ.
  11. 11. ITS OKAY NOT TO BE NORMALISED DON'T FEAR TO EMBED YOUR KID.
  12. 12. BUT..
  13. 13. SOMETIMES, ITS OKAY TO BE NORMALISED TOO! READ PERFORMANCE VS DATA DUPLICATION
  14. 14. SOMETIMES, ITS OKAY TO BE NORMALISED TOO! COMPLEX MODELLING / HIERARCHY
  15. 15. GET YOUR PRIORITIES RIGHT!
  16. 16. MONGODB <= 2.4 / MONGOID < 4.1
  17. 17. MONGODB >= 2.6 / MONGOID >= 4.1
  18. 18. PLEASE EXPLAIN!
  19. 19. PLEASE EXPLAIN! User .where(email:"***") .where(phone:"***")
  20. 20. PLEASE EXPLAIN! User .where(email:"***") .where(phone:"***") .explain()
  21. 21. PLEASE EXPLAIN! OMIT FIELDS IF FILTRATION< 90%
  22. 22. PLEASE EXPLAIN! COVER YOUR QUERIES
  23. 23. (SIDE)KIQ'D
  24. 24. (SIDE)KIQ'D
  25. 25. SIDEKIQ'D
  26. 26. SIDEKIQ'D
  27. 27. SIDEKIQ'D
  28. 28. SIDEKIQ'D LOAD BALANCER... CAUSE WE ARE LAZY!
  29. 29. SIDEKIQ'D ‣ MANAGE LATENCY ‣ WORKER LOAD
  30. 30. MAY THE FORCE BE WITH YOU KIRAN NARASAREDDY http://kco.re / @_kcore

×