SD Basics Flashcards
What are the pros and cons of horizontal vs vertical scaling?
- For horizontal scaling we need a load balancer to sit in front of our computer instances.
- With vertical scaling we have a single point of failure. Whereas with horizontal scaling we can redirect requests hence it is resilient.
- With horizontal scaling communication between instances happens via the network (RPC) but with vertical scaling it is with interprocess communication hence faster.
- Horizontally scaled apps need to handle data inconsistency.
- With vertical scaling there comes a limit to how much more computing power we can achieve.
What are some of most important paradigms in distributed programming?
Master/worker, Tuple spaces and MapReduce.
What are Tuple spaces?
A tuple space is a place where processes can put, read, and take tuples, which are in turn just sequences of values (“job”, “12”, “2”). A process can take or copy something from the tuple space.
What are two techniques for horizontally scaling a database?
- Data replication: For read-intensive workloads, you can have one primary copy that accepts data changes and multiple read-only replicas of that data. Here writes can become a bottleneck.
- Federated database: This involves distributing reads and write across many nodes. This is achieved by partitioning (sharding) the data across multiple database servers.
What is consistent hashing?
Hashing request ids and modulo mapping to a particular instance. But request ids are rarely random, since they sometimes encapsulate user information within hence the same user is often sent to the same instance and information is cached there. Changing the range of ids to dramatically when load balancing will cause this cached data to become invalid. something with consistent hashing…..