System design is the practice of outlining what it takes to build a service. Popular examples include questions like "How would you design a Twitter like service?" or "How would you implement a URL shortening service?". For these types of questions it's best to start by asking clarifying questions to get as much information about what you are being asked to build as possible.
The questions should focus on what kind of data needs to be stored, what types of functionality need to be accounted for, what will the traffic look like, will the traffic be consistent for modifying data as it is for viewing data, will you need to include the design for both the backend and front end of the system, etc?
General system design considerations for building a product are focused on what pieces/components will need to be in place, how they will interact with one another, and planning for the future of the product. Balacing tradeoffs of the various components and choosing which ones will best fit the application based on what is desired.
Learning resources #
- Grokking-The System Design Interview
- System Design Primer
- Designing Data-Intensive Applications - O'Reilly Books
General System Terms: #
Scalability: How a system will grow. There are two main types.
- Vertical Scaling: Adding more CPU, RAM, or storage to an existing server.
- Horizontal Scaling: Adding more servers.
Reliability: Pretty straight forward. What are the chances the service will fail. Often to create a more reliable service redundancy is introduced into the system.
Availability: another pretty straight forward concept. How often is the system available? High availability means that it will be available reliably.
Efficiency: Measurements like bandwidth and throughput of various messages throughout a system.
Manageability: How easy is it to maintain, diagnose, and fix a system.
System Components #
Load Balancers: Take requests and distribute them across a number of servers to provide a smoother response time by not over burdening any one server alone.
Caching: The act of saving a response for reuse for a period of time so that we can save on compute time.
Partitioning Data: ways to break down a database and host on multiple instances so data can be quicker to read anad wrtte
Indexes: depending on the frequency of writes a index might be a good idea as it is a job that will make the data quicker to read based
Proxy Server: An intermediate server that receives request and forwards them on. The original client can remain hidden if needed.
Redundancy and Replication: To make something reliably you need to eliminate as many single points of failure as possible. This means that you can add backups and redundancy to services. For databases you will need to also have a replication processes in place to ensure that the redundant databases match.
Relational vs Non-Relational Datbases:
- SQL: Good for when ACID is needed. Scales best vertically and can be harder to scale horizontally
- NoSQL: Best stores data of all types. Can be used in rapid development and storing less Atomicity, Consistency, Isolation, Durability
Share this by sharing it. Twitter me if you want to.
Published