the wizardry of scaling
play

The Wizardry of Scaling Ayende Rahien / Oren Eini - PowerPoint PPT Presentation

The Wizardry of Scaling Ayende Rahien / Oren Eini http://ayende.com/Blog ayende@ayende.com Scaling A service is said to be scalable if when we increase the resources in a system, it results in increased performance in a manner proportional


  1. The Wizardry of Scaling Ayende Rahien / Oren Eini http://ayende.com/Blog ayende@ayende.com

  2. Scaling A service is said to be scalable if when we increase the resources in a system, it results in increased performance in a manner proportional to resources added proportional to resources added Werner Vogels CTO - Amazon.com

  3. Scaling • # of requests • Data size • Complexity

  4. Scenario

  5. Attempt #1

  6. More Get Bigger Users Users Server Server

  7. More auth Get Bigger requests requests Servers Servers

  8. Requirements • Lock accounts • Personalization • Auditing

  9. End Result More requests More users More requirements ???

  10. Micro optimization as a way of life

  11. Traditional Architecture

  12. A single source of truth? Audit Login OLTP

  13. CAP • Consistency • Availability • Partition Tolerance Pick any two

  14. CAP http://www.julianbrowne.com/article/viewer/brewers - cap - theorem

  15. How to scale my app?

  16. Divide and Conquer

  17. Operations • Authenticate User • Audit all logins • Create User • Personalization information • Personalization information

  18. Solve just a single problem For N number of users, answer if user/pass combo is valid in constant time is valid in constant time Data Structures 101

  19. Code

  20. In memory / single machine • Single user memory usage – 56 bytes: – 16 chars / 32 bytes – username – 24 bytes – hashed password • 1,000,000 users = 53.4 Mb! • 1,000,000 users = 53.4 Mb! • 10,000,000 users = 534 Mb! • 100,000,000 users = 5.34 Gb!

  21. Scaling higher… A - C G - I D - F J - L M - O P - R S - U V - Z

  22. Operations • Authenticate User • Audit all logins • Create User • Personalization information • Personalization information

  23. Audits Record information about login attempts results Huge amounts of data Rarely Read

  24. System.IO.File

  25. Operations • Authenticate User • Audit all logins • Create User • Personalization information • Personalization information

  26. Create User • Email cycle • Register in system: – Personalization – Login – Login – Etc…

  27. Code

  28. A system of idiot savants

  29. Tailoring the solution • When breaking a system to independent components… – 3 tiers doesn’t make sense – Sharing among components is discouraged – Sharing among components is discouraged – Find the best solution for the problem at hand , vs. generic solutions.

  30. In .NET – Service Buses

  31. In .NET – Non SQL DBs

  32. Summary • Divide and conquer • Single task operations • Optimize for each task • There is no one infrastructure fits every task • There is no one infrastructure fits every task

  33. Questions?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend