System Design

http://highscalability.com/blog/2016/1/11/a-beginners-guide-to-scaling-to-11-million-users-on-amazons.html

  • Start with SQL and only move to NoSQL when necessary.
    • You aren’t going to break a SQL database with your first 10 million users. Not even close. (unless your data is huge).
    • nosql is for
      • If you need to store > 5 TB of data in year one or you have an incredibly data intensive workload.
      • Your application has super low-latency requirements.
      • You need really high throughput. You need to really tweak the IOs you are getting both on the reads and the writes.
      • You don’t have any relational data.
  • A consistent theme is take components and separate them out. This allows those components to scale and fail independently. It applies to breaking up tiers and creating microservices.
  • Only invest in tasks that differentiate you as a business, don’t reinvent the wheel.
  • Scalability and redundancy are not two separate concepts, you can often do both at the same time.

Vertical scaling has no failover or redundancy

You can also lighten the load by caching data from your database into ElastiCache. memcached, redis

SOA Design everything as a black box.

  • Tweet input statistics: 400m tweets per day; 5K/sec daily average; 7K/sec daily peak; >12K/sec during large events.
  • Timeline delivery statistics: 30b deliveries / day (~21m / min); 3.5 seconds @ p50 (50th percentile) to deliver to 1m; 300k deliveries /sec; @ p99 it could take up to 5 minutes