Caching Strategies in System Design: Types, Patterns, Trade-offs & Best Practices

Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided in this article.

System Design Basics - Caching
image_credit - DesignGuru.io

Hello friends, Caching is not just an important topic for System design interviews, its also technique in software development, enabling faster data retrieval, reducing load times, and enhancing user experience.

For developers, mastering caching concepts is crucial as it can significantly optimize application performance and scalability.

In the past, I have talked about common system design questions like API Gateway vs Load Balancer and Horizontal vs Vertical Scaling, Forward proxy vs reverse proxy as well common System Design problems and in this article we will explore the fundamentals of caching in system design and learn different caching strategies that are essential knowledge for technical interviews.

It's also one of the essential System design topics for interview and you must prepare it well.

In this article, you will learn ten essential caching concepts, ranging from client-side and server-side strategies to more advanced techniques like distributed caching and cache replacement policies

So what are we waiting for? let's start

By the way, if you are preparing for System design interviews and want to learn System Design in depth then you can also checkout sites like ByteByteGo, Design Guru, Exponent, Educative, Codemia.io and Udemy which have many great System design courses and a System design interview template like this which you can use to answer any System Design question.

how to answer system design question

If you need more choices, you can also see this list of best System Deisgn courses, books, and websites

P.S. Keep reading until the end. I have a free bonus for you.

What is Caching? Which data to Cache? Where to Cache?

While designing distributed system, caching should be strategically placed to optimize performance, reduce latency, and minimize load on backend services.

Caching can be implemented at multiple layers like

  1. Client-Side Cache
    This involves storing frequently accessed data on the client device, reducing the need for repeated requests to the server. It is effective for data that doesn't change frequently and can significantly improve user experience by reducing latency.

  2. Edge Cache (Content Delivery Network - CDN)
    CDNs cache content at the edge nodes closest to the end-users, which helps in delivering static content like images, videos, and stylesheets faster by serving them from geographically distributed servers.

  3. Application-Level Cache
    This includes in-memory caches such as Redis or Memcached within the application layer. These caches store results of expensive database queries, session data, and other frequently accessed data to reduce the load on the database and improve application response times.

  4. Database Cache
    Techniques such as query caching in the database layer store the results of frequent queries. This reduces the number of read operations on the database and speeds up data retrieval.

  5. Distributed Cache
    In a distributed system, a distributed cache spans multiple nodes to provide high availability and scalability. It ensures that the cached data is consistent across the distributed environment and can handle the high throughput required by large-scale systems.

When designing a caching strategy, it's crucial to determine what data to cache by analyzing usage patterns, data volatility, and access frequency.

Implementing an appropriate cache eviction policy (such as LRU - Least Recently Used, or TTL - Time to Live) ensures that stale data is purged, maintaining the cache's relevance.

Moreover, considering consistency models and cache invalidation strategies is vital to ensure that cached data remains accurate and up-to-date across the system.

And, here is a nice diagram on caching from DesignGuru.io to illustrate what I just said.

System Design Caching cheat shet


10 Caching Basics for System Design Interview

Here are 10 essential caching related basics and concepts every programmer must know before going for any System design interview.

1) client-side caching

Client-side caching is a fundamental technique where data is stored on the user's device to minimize server requests and improve load times. Two primary methods include:

  • Browser Cache: Stores resources like CSS, JavaScript, and images locally to reduce page load times on subsequent visits.
  • Service Workers: Enable offline access by caching responses, allowing applications to function without an internet connection.

In short:

  • browser cache: stores CSS, js, images to reduce load time\
    • service workers: enable offline access by caching response

Here is how client side caching looks like:

client side caching


2) server-side caching

This is another type of caching which involves storing data on the server to expedite response times for user requests.

Key strategies include:

  • Page Caching: Saves entire web pages, allowing faster delivery on subsequent requests .
  • Fragment Caching:
    Caches specific parts of a page, such as sidebars or navigation bars, to enhance loading efficiency.

  • Object Caching:
    Stores expensive query results to prevent repeated calculations

In short:

  • page caching: cache the entire web page
    • fragment caching: cache page components like sidebars, navigation bar\
    • object caching: cache expensive query results

Here is how server side caching looks like:

server side caching

image_credit --- ByteByteGo


3) Database caching

Database caching is crucial for reducing database load and improving query performance. Important techniques include:

  • Query Caching:
    Stores the results of database queries to quickly serve repeat requests.

  • Row Level Caching:
    Caches frequently accessed rows to avoid repeated database fetches.

In short:

  • query caching: cache db query results to reduce load
    • row level caching: cache popular rows to avoid repeated fetches

Here is an example of database caching on AWS:

database caching


4) application-level caching

Application-level caching focuses on caching within the application to reduce computation and data retrieval times. Strategies include:

  • Data Caching: Stores specific data points or entire datasets for quick access.
  • Computational Caching: Caches the results of expensive computations to avoid repeated processing.

In short:

  • data caching: cache specific data points or entire datasets\
    • computational caching: cache expensive computation results to avoid recalculation

application-level caching


5) Distributed caching

Distributed caching enhances scalability by spreading cache data across multiple servers, allowing high availability and fault tolerance.

In short, this type of caching just spreads cache across many servers for scalability

Here is how a distributed cache with Redis looks like:

distributed cache with Redis


6) CDN

Content Delivery Networks (CDNs) are used to cache static files close to users via edge servers, significantly reducing latency and speeding up content delivery.

In short, CDN store static files near users using edge servers for low latency

Also, here is a nice diagram on how CDN Works by DeisgnGuru.io

how CDN Works


7) cache replacement policies

Cache replacement policies determine how caches handle data eviction. Common policies include:

  • Least Recently Used (LRU): Evicts the least recently accessed items first.
  • Most Recently Used (MRU): Evicts the most recently accessed items first.
  • Least Frequently Used (LFU): Evicts items that are accessed least often.

In short:

- LRU: removes the least recently accessed items first\
- MRU: removes the most recently accessed items first\
- LFU: removes items that are accessed least often

cache replacement policies


8) hierarchical caching

Hierarchical caching involves multiple cache levels (e.g., L1, L2) to balance speed and storage capacity. This model is quit popular on CPU.

In short:

  • caching at many levels (L1, L2 caches) for speed and capacity

L1 and L2 Cache


9) cache invalidation

Cache invalidation ensures that stale data is removed from the cache. Methods include:

  • Time-to-Live (TTL): Sets an expiry time for cached data.
  • Event-based Invalidation: Triggers invalidation based on specific events or conditions.
  • Manual Invalidation: Allows developers to manually update the cache using tools.

In short:

- TTL: set expiry time\
- event based: invalidate based on events or conditions\
- manual: update cache using tools

Here is a nice System design cheat sheet about cache invalidation methods by DesignGuru.io to understand this concept better:

cache invalidation strategies


10) caching patterns

Finally, caching patterns are strategies for synchronizing cache with the database. Common patterns include:

  • Write-through: Writes data to both the cache and the database simultaneously.
  • Write-behind: Writes data to the cache immediately and to the database asynchronously.
  • Write-around: Directly writes data to the database, bypassing the cache to avoid cache misses on subsequent reads.

In short:

- write-through: data is written to the cache and the database at once\
- write-behind: data is written to the cache and asynchronously to database\
- write-around: data is written directly to the database, bypassing the cache

Here is another great diagram to understand various caching strategies, courtesy DesignGuru.io, one of the best place to learn System Design.

caching patterns

Best System Design Interviews Resources

And, here are curated list of best system design books, online courses, and practice websites which you can check to better prepare for System design interviews. Most of these courses also answer questions I have shared here.

  1. DesignGuru's Grokking System Design Course: An interactive learning platform with hands-on exercises and real-world scenarios to strengthen your system design skills.

  2. Codemia.io : This is another great platform to practice System design problems for interviews. It got more than 120+ System design problems, many of them are free and also a proper structure to solve them.

  3. "System Design Interview" by Alex Xu: This book provides an in-depth exploration of system design concepts, strategies, and interview preparation tips.

  4. "Designing Data-Intensive Applications" by Martin Kleppmann: A comprehensive guide that covers the principles and practices for designing scalable and reliable systems.

  5. LeetCode System Design Tag: LeetCode is a popular platform for technical interview preparation. The System Design tag on LeetCode includes a variety of questions to practice.

  6. "System Design Primer" on GitHub: A curated list of resources, including articles, books, and videos, to help you prepare for system design interviews.

  7. Educative's System Design Course: An interactive learning platform with hands-on exercises and real-world scenarios to strengthen your system design skills.

  8. High Scalability Blog: A blog that features articles and case studies on the architecture of high-traffic websites and scalable systems.

  9. YouTube Channels: Check out channels like "Gaurav Sen" and "Tech Dummies" for insightful videos on system design concepts and interview preparation.

  10. ByteByteGo: A live book and course by Alex Xu for System design interview preparation. It contains all the content of System Design Interview book volume 1 and 2 and will be updated with volume 3 which is coming soon.

  11. Exponent: A specialized site for interview prep especially for FAANG companies like Amazon and Google, They also have a great system design course and many other material which can help you crack FAAN interviews.

how to prepare for system design

image_credit - ByteByteGo

Conclusion

That's all about 10 essential Cache related concepts for System design interview. Caching can improve the performance and scalability of your application. So use it carefully. Understanding and implementing these caching concepts can significantly enhance application performance, scalability, and user satisfaction.

Other System Design Articles and Resources you may like

Thanks for reading this article so far. If you like this Twitter system design interview solution then please share it with your friends and colleagues. If you have any questions feel free to ask in the comments.

Bonus\
As promised, here is the bonus for you, a free book. I just found a new free book to learn Distributed System Design, you can also read it here on Microsoft --- https://info.microsoft.com/rs/157-GQE-382/images/EN-CNTNT-eBook-DesigningDistributedSystems.pdf

System design tutorials

SQL Query Execution Order: How SQL Queries Actually Work (Must Know for Interviews)

Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided in this article.

SQL query execution order

Hello guys, one of the common question on technical interviews about SQL is how exactly SQL query work? While this may seems simple, many programmers including experienced one fail to answer this with confidence.

Many developer don't even know how the SQL commands are executed and in which order?

For them the SQL query is executed as they are written but that's not true, you can see from the above diagram that FROM and JOIN is executed before you can SELECT anything, which is again very rational if you think through.

Earlier, I have shared 20 SQL queries from interviews and 50 System design questions and in this article, I am going to answer how exactly SQL query works under the hood, so stay tuned and continue reading.

And, if are preparing for tech interviews and you need more questions not just queries but also database and SQL related questions from other topics like indexes, joins, group by, aggregation, and window functions then you can also checkout these 200+ SQL Interview Questions .

This course is one of the specially designed course to prepare you for SQL interviews by answering popular questions. You can also get this for big discount now.

How exactly SQL Query is executed?

Structured Query Language or SQL is the standard language for managing and manipulating relational databases.

It provides a powerful and efficient way to interact with data, enabling developers, analysts, and data scientists to retrieve, insert, update, and delete information from databases.

While SQL queries are written in a declarative, human-readable format, there is a complex process that occurs behind the scenes to execute these queries and retrieve the desired results.

In this article, we'll delve into the inner workings of SQL queries, breaking down the process step by step.

1. Query Parsing and Tokenization

The journey of an SQL query begins with parsing and tokenization. When a user submits an SQL query, the database management system (DBMS) must first break down the query into individual tokens.

Tokens are the smallest units of the query and can include keywords (SELECT, FROM, WHERE, etc.), table and column names, operators (=, >, <, etc.), and values.

This process involves identifying the syntax and structure of the query to ensure it follows the rules of the SQL language.

how SQL query are executed


2. Query Optimization

Once the query is parsed and tokenized, the DBMS performs query optimization. This is a crucial step that aims to improve the efficiency of query execution.

The DBMS analyzes the query and explores various execution plans to determine the most efficient way to retrieve the requested data.

It considers factors such as indexes, table relationships, and available resources to create an execution plan that minimizes the time and resources needed to complete the query.

how to do query optimization


3. Execution Plan Generation

The chosen execution plan outlines the sequence of steps required to fulfill the query.

It determines the order in which tables are accessed, the types of joins performed, and the filtering conditions applied.

The DBMS generates this plan based on statistical information about the data distribution and the database schema.

The goal is to reduce the amount of data that needs to be processed and to optimize disk and memory usage.

On Microsoft SQL Server, a Query Execution plan looks like below:

how Execution plan looks like


4. Data Retrieval and Joins

With the execution plan in place, the DBMS begins the process of data retrieval. If the query involves multiple tables, the DBMS performs join operations to combine the relevant data.

Joining tables efficiently requires comparing and matching rows based on specified conditions. Depending on the type of join (inner join, outer join, etc.), the DBMS determines which rows from each table should be included in the result set.

How SQL join works


5. Filtering and Sorting

After joining the necessary tables, the DBMS applies filtering conditions specified in the WHERE clause. This involves evaluating each row to determine whether it meets the criteria set by the user.

Rows that do not satisfy the conditions are discarded, while those that pass the filter are retained for further processing.

Additionally, if the query includes an ORDER BY clause, the DBMS will sort the resulting rows based on the specified column(s).

Sorting involves arranging the data in a specific order, such as ascending or descending, to produce the final ordered result set.

When does filtering and sorting happens in SQL Query Execution


6. Aggregation and Grouping

Aggregation functions such as SUM, COUNT, AVG, MIN, and MAX are commonly used in SQL queries to perform calculations on groups of data.

If the query includes a GROUP BY clause, the DBMS groups the rows based on the specified columns. It then applies the aggregation functions to each group separately, producing summary statistics or calculations for the grouped data.

Aggregation and Grouping in sQL query


7. Result Set Generation

With all the necessary operations performed, the DBMS generates the final result set. This set of rows and columns represents the data that satisfies the user's query. T

he result set is then returned to the user or the application that initiated the query.

when is result generated from SQL query


8. Index Utilization

Indexes play a vital role in optimizing the performance of SQL queries. An index is a data structure that provides a quick way to look up data based on specific columns.

When executing a query, the DBMS may utilize indexes to efficiently locate the relevant rows, reducing the need for full-table scans and improving query response times.

Index Utilization in SQL query


9. Transaction Management

Transactional operations in SQL, such as INSERT, UPDATE, and DELETE, involve modifying data in the database. These operations are grouped into transactions, which ensure data consistency and integrity.

When a transaction is initiated, the DBMS may lock the affected rows or tables to prevent other transactions from accessing or modifying them concurrently.

Once the transaction is completed, the changes are either committed to the database or rolled back, depending on the success or failure of the transaction.

Transaction Management in SQL


10. Caching and Memory Management

Modern database systems employ various caching and memory management techniques to optimize query performance.

Caching involves storing frequently accessed data in memory to reduce the need for disk reads, which are slower in comparison.

The DBMS may also use buffer pools to manage memory allocation for query execution and result set generation, further enhancing efficiency.

Caching and Memory Management in SQL


SQL Query Order? How SQL Query are executed under the hood?

It's also important to know and remember in which order various SQL commands like SELECT, FROM, COUNT, WHERE, HAVING, ORDER BY, JOIN etc are applied

SQL queries are processed in a specific order, and understanding this order is crucial for writing and optimizing queries effectively. The typical order of SQL query processing involves the following steps:

  1. FROM: The query begins by specifying the source tables or views from which the data will be retrieved. This clause defines the primary data source for the query.

  2. JOIN: If the query involves multiple tables, the JOIN clause is used to combine data from different tables based on specified conditions. Different types of joins (INNER JOIN, LEFT JOIN, RIGHT JOIN, etc.) determine how rows from each table are matched and included in the result set.

  3. WHERE: The WHERE clause is used to filter rows based on specific conditions. It restricts the data to only those rows that meet the specified criteria. Rows that do not satisfy the conditions are excluded from further processing.

  4. GROUP BY: If aggregation is required, the GROUP BY clause is used to group rows with similar values in specified columns. This step is often used in conjunction with aggregation functions like COUNT, SUM, AVG, etc. to perform calculations on grouped data.

  5. HAVING: The HAVING clause is used to filter the result set after the GROUP BY operation has been performed. It specifies conditions for filtering aggregated data. Similar to the WHERE clause, rows that do not meet the criteria are excluded from the final result.

  6. SELECT: The SELECT clause is used to specify the columns that should appear in the final result set. It determines which data will be retrieved and displayed in the query output.

  7. DISTINCT: The DISTINCT keyword, if used, removes duplicate rows from the result set, ensuring that only unique values are displayed.

  8. ORDER BY: The ORDER BY clause is used to sort the result set based on specified columns. It arranges the rows in ascending or descending order, as specified.

  9. LIMIT/OFFSET or FETCH/FIRST: Depending on the database system, you might use LIMIT (or FETCH or FIRST) and OFFSET clauses to control the number of rows returned and to implement pagination.

  10. UNION/INTERSECT/EXCEPT: If needed, these set operations can be used to combine the results of multiple queries.

Here is a nice diagram from Medium which clearly explains how the SQL query looks like and how its executed by Query engine:

SQL Query execution order

It's important to note that the actual order of execution may vary based on the specific database management system being used.** However, the logical processing order remains consistent across most SQL databases.

Additionally, modern query optimizer may rearrange some of these steps for performance reasons while ensuring that the final result remains accurate and consistent.

Understanding the order of SQL query processing not only help in technical interviews but also allows you to write efficient and effective queries, and it provides insights into query optimization and performance tuning.

By structuring your queries with this order in mind, you can better control the flow of data and achieve the desired results.

Conclusion

That's all about how SQL query are executed under the hood. SQL queries might seem like simple statements, but there is a complex process that unfolds behind the scenes to retrieve, manipulate, and manage data.

From parsing and optimization to execution plan generation and result set generation, every step is meticulously orchestrated to ensure efficient and accurate query processing.

Understanding how SQL queries work under the hood provides developers and database administrators with valuable insights into performance optimization and query tuning, ultimately leading to better utilization of database resources and improved application responsiveness.

And, if are preparing for tech interviews and you need more questions not just queries but also database and SQL related questions from other topics like indexes, joins, group by, aggregation, and window functions then you can also read Grokking the SQL Interview book or join 200+ SQL Interview Questions .

Both are great resources to prepare you for SQL interviews by answering popular questions.

All the best !!

    Top 10 Microservice Best Practices for System Design Interview

    Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided in this article.

    Microservices best practices

    credit - Design Guru

    Hello guys, it's no secret that Microservices have revolutionized the way we build applications, providing scalability, flexibility, and resilience, but its not easy to build Microservices which withstand test of time and test of production.

    To ensure the success of microservices architecture, it is crucial to follow best practices that address key challenges and promote effective development and deployment strategies.

    In the past, I have also shared about Database Sharding, System design topics, Microservice Architecture, and System design algorithms and today, I will share 10 microservice best practices that can help you build scalable and resilient applications.

    These are the best practices I believe every experienced Java developer should know.

    By the way, if you are preparing for System design interviews and want to learn System Design in depth then you can also checkout sites like ByteByteGo, Design Guru, Exponent, Educative and Udemy which have many great System design courses

    how to answer system design question

    P.S. Keep reading until the end. I have a free bonus for you.

    Top 10 Microservice Best Practices for Building Scalable Applications

    By breaking down applications into smaller, independent services, organizations can achieve scalability, flexibility, and resilience. However, successfully implementing microservices requires following best practices to ensure the desired benefits.

    Here are 10 essential Microservice best practices that can help you build scalable and resilient applications.

    1. Separate Data Store for Each Service

    One of the fundamental principles of microservices is to maintain separate data stores for each service. This approach ensures that each microservice has control over its data and avoids tight coupling between services.

    By using database-per-service pattern or distributed data management techniques, such as event sourcing or CQRS, you can achieve data isolation and enhance scalability and resilience.

    Microservices best practices


    2. Keep Code at a Similar Level of Maturity

    Maintaining a consistent level of maturity across microservices is essential for a cohesive and maintainable architecture.

    It is crucial to avoid situations where some microservices are significantly more mature or advanced than others.

    By aligning the development progress and capabilities of microservices, you can avoid dependencies and simplify the overall system design.

    best practices for microservices architecture


    3. Separate Build for Each Microservice

    To maintain the independence of microservices, it is essential to separate the build process for each service.

    This practice enables individual teams to develop, test, and deploy their microservices without impacting others.

    By decoupling the build and release processes, you can achieve faster iterations and reduce the risk of introducing bugs or regressions across the system.

    Separate Build for Each Microservice best practice


    4. Separate Repository for Each Microservice

    Microservices should have their own code repositories to enable independent versioning, branching, and release management. Separate repositories facilitate decentralized development and deployment, allowing teams to work autonomously.

    Each Microservice's repository should contain the code, configuration files, and deployment scripts specific to that service

    Separate Repository for Each Microservice


    5. Deploy Using Containers (Docker)

    Containerization, particularly with Docker, has become a popular choice for deploying microservices.

    Containers provide lightweight and isolated runtime environments that encapsulate microservice dependencies and configurations.

    By packaging microservices into containers, you can achieve consistent deployment across different environments, simplify scaling, and improve portability.

    why deploy Microservices Using Containers (Docker)


    6. Stateless Design (Treat Server as Stateless)

    Adopting a stateless design for microservices helps improve scalability and resilience. Each microservice should treat the server as stateless, meaning it does not store session-specific data.

    Instead, it relies on external services or databases to maintain state if required. Stateless services can be easily scaled horizontally to handle increased traffic and provide fault tolerance and load balancing.

    This is also one of the most important lesson I learned in my software development career, always choose Stateless and keep it stateless as long as you can.

    Why Stateless Services are better


    7. Domain-Driven Design

    Domain-driven design (DDD) is a software development approach that aligns business requirements with the software architecture.

    By organizing microservices around specific domains or business capabilities, you can achieve a more cohesive and maintainable system. DDD emphasizes the modeling of business entities, aggregates, and bounded contexts, ensuring that microservices are closely aligned with business needs.

    How Domain-Driven Design is best practice


    8. Micro Frontend

    Micro frontend architecture extends the principles of microservices to the frontend layer.

    It involves breaking down the user interface into smaller, self-contained modules that can be developed and deployed independently.

    By adopting micro frontend, you can achieve frontend scalability, independent deployment, and improved user experience through modular and reusable components.

    best practice to create Microservices apps


    9. Single Responsibility

    Applying the single responsibility principle to microservices ensures that each service has a specific and well-defined purpose. Each microservice should focus on a particular business capability or functionality.

    This practice enhances modularity and allows for independent development, testing, and deployment. Avoid creating monolithic services that handle multiple responsibilities, as it can lead to tightly coupled and complex architectures.

    Single Responsibility principle for Microservices


    10. Loose Coupling and High Cohesion

    Microservices should be loosely coupled, meaning they can operate independently without strong dependencies on other services. Loose coupling allows for independent scaling, deployment, and modification of services.

    Additionally, strive for high cohesion within each microservice, ensuring that its components are closely related and work together to fulfill a single purpose.

    Well-defined APIs, contracts, and communication protocols are key to achieving loose coupling and high cohesion.

    Loose Coupling and High Cohesion why


    11. Use Kubernetes for Scaling [Bonus]

    This is a bonus best practice for you because you have read the article till the end. Kubernetes is a powerful container orchestration platform that simplifies the management and scaling of microservices.

    It provides features like automatic scaling, load balancing, service discovery, and self-healing capabilities.

    By leveraging Kubernetes, you can dynamically scale your microservices based on resource usage, distribute traffic efficiently, and ensure high availability and fault tolerance.

    why use Kubernetes for Scaling


    System Design Interviews Resources:

    And, here are curated list of best system design books, online courses, and practice websites which you can check to better prepare for System design interviews. Most of these courses also answer questions I have shared here.

    1. DesignGuru's Grokking System Design Course: An interactive learning platform with hands-on exercises and real-world scenarios to strengthen your system design skills.

    2. "System Design Interview" by Alex Xu: This book provides an in-depth exploration of system design concepts, strategies, and interview preparation tips.

    3. "Designing Data-Intensive Applications" by Martin Kleppmann: A comprehensive guide that covers the principles and practices for designing scalable and reliable systems.

    4. LeetCode System Design Tag: LeetCode is a popular platform for technical interview preparation. The System Design tag on LeetCode includes a variety of questions to practice.

    5. "System Design Primer" on GitHub: A curated list of resources, including articles, books, and videos, to help you prepare for system design interviews.

    6. Educative's System Design Course: An interactive learning platform with hands-on exercises and real-world scenarios to strengthen your system design skills.

    7. High Scalability Blog: A blog that features articles and case studies on the architecture of high-traffic websites and scalable systems.

    8. YouTube Channels: Check out channels like "Gaurav Sen" and "Tech Dummies" for insightful videos on system design concepts and interview preparation.

    9. ByteByteGo: A live book and course by Alex Xu for System design interview preparation. It contains all the content of System Design Interview book volume 1 and 2 and will be updated with volume 3 which is coming soon.

    10. Exponent: A specialized site for interview prep especially for FAANG companies like Amazon and Google, They also have a great system design course and many other material which can help you crack FAANG interviews.

    how to prepare for system design

    image_credit - ByteByteGo

    Remember to combine theoretical knowledge with practical application by working on real-world projects and participating in mock interviews. Continuous practice and learning will undoubtedly enhance your proficiency in system design interviews.

    Conclusion

    That's all about the 10+ Microservices best practices you can follow to create a better, scalable and more robust Microservice applications. It's no secret that implementing microservices architecture requires adherence to best practices that address key challenges in scalability and resilience.

    By following best practices such as separate data store for each microservice, maintaining single responsibility, achieving loose coupling and high cohesion, and using tools like Docker and Kubernetes, you can build scalable and resilient Microservice applications.

    Additionally, adopting stateless design, domain-driven design, micro front-end, and ensuring similar code maturity across microservices will contribute to a successful microservices architecture that can adapt to evolving business needs.

    This is also one of the popular topic for System Design interviews. If you are preparing for Software Engineer interview which require System Design skills then you can also prepare System design Questions like API Gateway vs Load Balancer and Horizontal vs Vertical Scaling, Forward proxy vs reverse proxy, how to manage transactions in Microservices, and difference between SAGA and CQRS Pattern, they are quite popular on interviews.

    Bonus

    As promised, here is the bonus for you, a free book. I just found a new free book to learn Distributed System Design, you can also read it here on Microsoft --- https://info.microsoft.com/rs/157-GQE-382/images/EN-CNTNT-eBook-DesigningDistributedSystems.pdf

      I Tried 20+ System Design Interview Courses on Udemy: Here Are My Top 5 Recommendations for 2026

      Top 6 Udemy Courses to Learn High Level and Low Level System Design

      Hello guys, if you are preparing for Software Engineer or Software Developer Job interview then you may know that how important is to prepare for System Design, especially if you want to get a developer job on top tier company like Amazon, Google, Meta, Apple and Netflix.

      In the past, I have shared several resources for System design interview preparation like best System Design Interview Books, websites, and popular Software design questions for practice, and today, I am going to share best System Design courses from Udemy, one of my favorite place to learn anything related to tech.

      Why Udemy? Well, my reason to choose Udemy was mainly for its affordable price. There is no other place where you can find 50+ hours of top quality courses for just $10.

      Apart from price, choice is another reasons why I like to learn on Udemy. It’s the largest market place of online courses and you will have plenty of choices.

      If you enroll in a course and don’t like the instructor or his way of explanation or content, you can ask for refund and choice another course.

      This is the facility, which I have never found anywhere else, except subscription based sites like Educative , ByteByteGo, Design Guru, Exponent, Codemia.io, and Bugfree.ai.

      That’s why I always go to Udemy to enroll into the System Design courses and today I am going to share few gems from my collection.

      By the way, if you are in hurry then just go and join Mastering the System Design Interview by Frank Kane, a 5 hour course from an ex Amazon Hiring manager where he share proper process and insider tips to crack the System design interviews on FAANG or MAANG companies.


      You can also get this course now for just $10 as Udemy is running their biggest sale. I already bought 50+ courses to learn in-demand skills this year. You can also join this course for a discount, you will thank me later.

      6 Best High Level and Low Level System Design Courses You can Join on Udemy in 2026

      Without any further ado, here is my favorite System design courses you can join on Udemy. These System design courses are created by System design expert and current and ex-FAANG employees who have served on both side of table.

      I mean they have not only cleared the interviews as a candidate but also taken interviews as hiring manager.

      There are plenty to learn form these experienced hands and these course provide that opportunity to you. If you are serious about your System design interview preparation then you will love these courses for sure.

      1. Mastering the System Design Interview by Frank Kane

      This was one of the first System design interview course I joined on Udemy. I have known Frank Kane from his previous courses on Big Data and Scala and was big fan of his teaching style and content.

      So, when he release his System design course, I immediately joined the course and I must say I wasn’t disappointed.

      The course not only cover key system design concepts like caching, scalability, sharding, security, and software architecture but also answer frequently asked System design questions like difference between Horizontal and Vertical Scaling, and API Gateway vs Load Balancers.

      The course not only touch base upon Big Data, ACID properties, Data Structures and Algorithms but also share strategies to tackle pressure of System design interviews and how to answer system design questions.

      For practice, you will also solve popular System Design problems like URL Shortening, and Web Crawlers and learn how to apply your knowledge on solving System design problem.

      Talking about social proof, more than 62,373 students have already joined this course and it has on average 4.6 rating from close to 8800 raters which is amazing.

      Frank has done amazing job with this course. I highly recommend this course to anyone who is preparing for System Design interview in 2026.

      Here is the link to join this course Mastering the System Design Interview by Frank Kane


      2. Rocking System Design by Rajdeep Saha

      If you need an alternative of Frank’s course then you can checkout this Rocking System Design course by Rajdeep Saha. This one was my first course of Rajdeep and I didn’t know him before. Rajdeep is a AWS solution architect and that shows in his course.

      In this course, you will not only learn how to answer System design questions on interview but also learn about Cloud Computing, particularly AWS and how to design applications for Cloud.

      This 9-hour online course covers AWS implementation of the design using Kubernetes, Lambda, API Gateway, EC2, ALB, NLB etc, and also touch base upon core system design concepts like scaling, sharding, hashing, microservices, load balancers, security, well architected framework, and more

      The course is also full of quizzes and exercises. You can test your knowledge with up-to-date system design quizzes. Talking about social proof, more than 13,381 engineers have already joined this course and on average it has 4.5 rating which is quite amazing.

      Here is the link to join this course — Rocking System Design by Rajdeep Saha


      By the way, if you want to join multiple course on Udemy, its may be worth getting a Udemy Personal Plan, which will give instant access of more than 11,000 top quality Udemy courses for just $30 a month.

      3. System Design Interview Guide for Software Architecture by CodeKarle

      This is another Udemy course on System Design interview which is created by an ex FAANG engineer, Sandeep Kaul. Sandeep is an Experienced Tech Lead/Architect with a huge breadth and depth of knowledge based on his experience on a wide variety of technologies that he has worked on in his career, and that shows in this course.

      In this System Design Interview Guide you will not only learn the strategy to crack your next High Level System Design Interview but also learn about Distributed Systems, Microservices Architecture, Databases, Software Architecture, Analytics, and Design Patterns, which will also be used in your day-to-day task and help become a better engineer.

      You will also find solutions to the most common Interview Questions at FAANGs like how to design WhatsApp, how to design Uber, How to design Amazon, How to design Twitter, YouTube, AirBnb and many other real apps.

      The course also comes with a lot of quizzes and coding problems which you can use to further solidify your knowledge .

      In short, one of the best course on high level system design. I absolutely loved it. Sandeep covers each topic in sufficient detail and his deep understanding of various technical aspects shines throughout the course.

      I highly recommend it to anyone interested in taking their system design skills to the next level.

      Here is the link to join this course — System Design Interview Guide for Software Architecture by CodeKarle


      4. Pragmatic System Design by Alexey Soshin

      This 5-hour long System design interview course on Udemy is created by Alexy Soshin, a Senior Solutions Architect at Amazon Web Services. Alexy is a well known expert in System design and also author of “Kotlin Design Patterns and Best Practices” book.

      He has also one of the coauthor of “97 Things Every Java Programmer Should Know” book, one of my favorite Java book of recent time. Where you will find 97 essays from different expert on key technical topics.

      In this System design course on Udemy, you will learn not only learn how ow to solve most popular FANG interview questions but also

      • important scalability concepts
      • Common communication protocols
      • Caching and Redis
      • Concurrency
      • Database design and PostgreSQL
      • Sharding strategies, and much more.

      Talking about social proof, more than 26,522 software engineers have already joined this course and on average it has 4.3 rating out of 5 which is great.

      Here is the link to join this course Pragmatic System Design by Alexey Soshin

      5. The “BigTech” System Design Interview Bootcamp

      If you are looking for a bootcamp style course to prepare for System design interview in 2026 then you will love this course. It provides complete guide to nail your next System Design Interview with Hands-On, Project-Based learning with discord community!

      Created by Fabien HinsenKamp, an SSE @ Amazon, this course provides Hands-on experience with component-level system design and real-world application through 10 mock interview challenges.

      The course also provides a prefect introduction to System Design, what I loved about this course was not just the technical information taught, but also the tips provided on how to crack the technical interview.

      Since Fabien is already working in Microsoft and have gone through the same path and crack the code, his tips are battle hardened and quite valuable.

      Fabian ia also very responsive and available on Udemy and Discord for Questions and Queries. And he does not spoon-feed the answers, but ignites that curiosity to learn more about the topics you find interesting, which a sign of a great teacher.

      If you want to crack your next System Design interview and just starting then you can join this course. More than 22,292 students have already joined this course.

      Here is the link to join this course — The “BigTech” System Design Interview Bootcamp

      6. Low Level System Design [An interview perspective]

      While most of the course in this list covers high level system design I thought to include one course from Low Level system design to balance things out and also because Low Level System design is also important for crack tech interviews.

      Created by Abhishek Ghosh, this course will teach you how to begin coding by keeping extensibility in mind. You will learn how to weed out unnecessary information from the problem definition, identify traction, and create a class diagram with it

      You will also learn about how to write test cases for the problem as and when required and gain necessary exposure and modifications to the API for code sustainability

      The course also teach you how to use encapsulation when required and generate desired accessors and mutators. Most importantly you will learn how to complete code during interview time and ain insight into fallback plans in emergency cases, which always happens.

      Talking about social proof, more than 4,810 students have already joined this course and it has on average 4.5 rating which is quite nice for a low level system design course. If you want to master Low Level System design, I highly recommend this course.

      Here is the link to join this course — Low Level System Design [An interview perspective]


      That’s all about the best online courses you can join to prepare for System Design interviews on Udemy. System Design is very vast topic that’s why you need a couple of courses to really cover them.

      I have learned better when I learn from two different instructors and that’s why I have shared System Design courses from different instructor in this list.

      Also, all these courses are very affordable and you can get it for just $10 now on Udemy Sale. Even if you don’t have time to watch the course now, you can enroll at them now at a lower price to save money and complete it later when you have time.

      I have already bought 50+ courses on recent Udemy sale on System Design, Programming and other technical topics.

      And, if you want to join multiple course on Udemy, its may be worth getting a Udemy Personal Plan, which will give instant access of more than 11,000 top quality Udemy courses for just $30 a month.

      Other Programming Articles and Tutorials you may like

      Thanks for reading this article so far. If you like these System design interview courses form Udemy then please share with your friends If you got any other System design course which should be in this list, let me know in comments. Everybody loves great resources and happy learning System design.

      P. S. — If you want to do just one thing to learn System Design in depth then I also suggest you to checkout Frank Kane’s Mastering the System Design Interview course on Udemy. Frank is an ex-hiring manager and know what it takes to crack System design interview of those big FAANG companies .