System Design Flashcards
What is a single point of failure?
When you have a component in your system solely responsible for one thing, if it goes down that whole functionality goes down which is bad
Disadvantages of MySQL?
- Have to create unique index hases to serve scans quickly, and keep those indexes in memory
What are cons of master slave db replication?
All writes happen on master, SINGLE POINT OF FAILURE = MASTER
What are advantages of MySQL?
- Widely used and mature
- Clear scaling paradigms like master/slave and master/master replication, sharding.
- Big tech uses
- Fast index lookups comparable to nosql
How can you make your app to handle more users?
Horizontal and vertical scaling
What are some downsides of database sharding?
Shard capacity/splitting, complicate joining,
What is database sharding and its advantages?
Horizontal scaling of db’s, high availability, faster queries since smaller boxes, more write throughput,
What is vertical scaling and its cons?
Increase resources/spend more money
Cons: Bottleneck + expensive
What is RAID-0,1,5,10?
Stripe data across n hard-drives
Write data in whole to each drive
Only 1/5 disks are copy/redundant
If using MySQL, how do you perform fast lookups repeatedly?
Store unique index hashes in memory
When deciding on a db to use, what are some things to consider?
- The amount and type of data being stored
- If any relationships between data’s
- Number of reads vs number of writes
- Need quick lookups?
What’s database replication?
Copy databases, master slaves, slaves do everything masters do
What is horizontal scaling and its cons?
Increase number of machines/servers
Cons: Need to figure out how to distribute load across servers
How do you handle load balancing?
Round-robin DNS resolving