Absolute Basics of System Design Everyone Needs To Know

Fateh Ali Aamir
5 min readOct 28, 2024

Photo by Alex wong on Unsplash

Building applications that can expand, manage high traffic volumes, and remain responsive under demanding use requires careful consideration of system design. Knowing the fundamentals, such as layering, microservices, caching, and load balancing, can help you build robust, flexible systems, regardless of how big or small your project is. This article deconstructs these fundamental ideas of system architecture and demonstrates how each component promotes reliable and effective applications.

Layered Architecture

In a layered architecture, the application is divided into distinct layers, such as the UI (View), business logic (Controller), and data access (Model), each with its responsibility and in most cases, referred to as the MVC design. For instance, in a web application such as an online store, the data access layer would retrieve and store product information from a database, the business logic layer would process orders, and the user interface layer would manage user interactions. This separation enhances modularity, making it easier to update individual layers without affecting others, which improves maintainability and scalability.

Event-Driven Architecture

Emitting and responding to events allows components to interact in an event-driven architecture, decoupling them and enhancing scalability. This design could be used to process orders asynchronously in an e-commerce site. The system creates an “order placed” event when a customer puts an order, which starts several services (such as shipping and inventory management). Because services can function independently and scale as needed to handle events, this configuration — which is frequently controlled with message brokers like RabbitMQ or Apache Kafka — makes the system adaptable.

Asynchronous Processing

Time-consuming operations are offloaded by asynchronous processing, which enhances performance in general. Slack, for instance, frees up resources to answer other requests in real time by assigning laborious activities, such as file uploads or message processing, to background workers. By scheduling jobs to be processed later, message queues like RabbitMQ or Amazon SQS make this possible, allowing the application to expand effectively and maintain responsiveness even under high load.

Microservices Architecture

Microservices architecture breaks down an application into smaller, independent services that each handle a specific function, like user management or payment processing. For example, Netflix uses microservices to control various aspects of its streaming service, enabling it to independently scale particular services (such as video playback) in response to demand. Through network protocol communication, microservices allow various teams to independently create, implement, and scale each service, enhancing scalability and robustness.

API Gateways and Service Mesh

An API gateway acts as a single entry point for client requests, handling tasks like authentication, routing, and load balancing. In microservices setups like Uber’s, an API gateway manages external requests, directing them to appropriate services based on availability. Internally, a service mesh (e.g., Istio) manages communication between services, handling retries and load balancing within the system, which enhances scalability and resilience by optimizing both external and internal traffic flow.

Load Balancing

To avoid overloading a single server, load balancing divides incoming traffic among several servers. For example, load balancers are used by Google’s search engine to distribute millions of requests per second among several servers. High availability and fault tolerance are supported by the load balancer, which makes sure that no one server becomes a bottleneck and maintains the application online and responsive even during peak traffic.

Horizontal and Vertical Scaling

While vertical scaling entails boosting the capabilities of a single server, horizontal scaling entails adding multiple servers. With features like Auto scalability, which dynamically modifies the number of servers in response to traffic, Amazon Web Services (AWS) makes horizontal scalability easier. An e-commerce site might, for instance, expand horizontally during a significant sale event by adding extra servers to accommodate the spike in users, whereas vertical scaling might boost an existing server’s RAM or CPU capacity, which is best suited for modest traffic growth.

Caching

Caching eliminates the need to continually retrieve frequently accessed data from a database by temporarily storing it in memory. Redis, for instance, is used by Twitter to cache user timelines, enabling quicker access without requiring a database query each time. Caching improves performance and scalability by speeding up response times and lowering server load, particularly during periods of high traffic. Some major caching systems to explore are Redis and Dragonfly DB.

Database Sharding and Partitioning

With database sharding, a big database is split up into smaller, easier-to-manage chunks that are each kept on a different server or cluster. To maintain data for various people across several servers, Facebook, which has billions of users, shards its user database. This strategy lessens strain and permits the database to extend horizontally as user data increases by allowing each server to manage a portion of the total data.

Developers may create adaptable, simple-to-maintain apps that function effectively under duress by understanding the fundamentals of system architecture. You can select the best tools for every project by knowing how components like load balancing, caching, and microservices work. These fundamentals enable the creation of systems that can grow with the company and change with the times, guaranteeing enduring dependability and performance.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Fateh Ali Aamir
Fateh Ali Aamir

Written by Fateh Ali Aamir

23. A programmer by profession. A writer by passion.

No responses yet

Write a response