20 System Design Concepts Explained in 10 Minutes

NeetCode
11 Mar 202311:40

Summary

TLDRThis video script offers an insightful guide for developers aiming to scale applications and enhance their system design skills. It covers essential concepts like vertical and horizontal scaling, load balancing, CDNs, caching, IP addressing, TCP/IP protocols, HTTP, REST, GraphQL, gRPC, WebSockets, and databases including SQL and NoSQL. It also delves into replication, sharding, and the CAP theorem, providing a comprehensive overview of building scalable and robust systems.

Takeaways

  • πŸš€ Vertical scaling involves adding more resources like RAM or upgrading the CPU to scale a server, but it has limitations.
  • πŸ”„ Horizontal scaling adds server replicas to handle more requests, allowing for almost infinite scaling and redundancy but introduces complexity.
  • πŸ”„ Load balancers distribute incoming requests to multiple servers, preventing overload and providing fault tolerance.
  • 🌐 Content Delivery Networks (CDNs) serve static files from a network of servers worldwide to reduce latency and improve performance.
  • πŸ’Ύ Caching is a technique to store copies of data for faster retrieval, used at various levels including browser, disk, and CPU cache.
  • 🌐 IP addresses uniquely identify network devices, and the Internet Protocol Suite (TCP/IP) defines the rules for data transmission over the internet.
  • πŸ”„ TCP is a reliable protocol that ensures data packets are sent and received in order, and is the foundation for many other protocols like HTTP and WebSockets.
  • 🌐 DNS translates domain names to IP addresses, with DNS records like A records mapping domains to server IP addresses for quick access.
  • πŸ“š HTTP is an application-level protocol that simplifies data transmission over TCP, following a client-server model with request and response headers and bodies.
  • πŸ”„ REST is a popular API pattern that standardizes HTTP APIs, making them stateless and following consistent guidelines for responses.
  • πŸ“ˆ GraphQL allows clients to make a single request to fetch exactly the resources they need, reducing over-fetching and the number of requests.
  • πŸ”„ gRPC is an RPC framework that uses Protocol Buffers for efficient binary data serialization, improving performance over REST APIs that use JSON.
  • πŸ”„ WebSockets enable bi-directional communication, allowing for real-time data transfer without the need for polling, as in chat applications.
  • πŸ’Ύ SQL databases organize data into tables and rows, providing efficient storage and retrieval with ACID compliance for reliability.
  • πŸ”„ NoSQL databases drop the consistency requirement of ACID and the relational model, allowing for horizontal scaling and different data models like key-value, document, and graph stores.
  • πŸ”„ Sharding and replication are techniques used in databases to scale horizontally and improve read performance, respectively.
  • πŸ”„ The CAP theorem highlights the trade-offs in distributed systems between consistency, availability, and partition tolerance.
  • πŸ”„ Message queues provide durable storage and can be used for decoupling parts of an application, allowing for asynchronous processing of data.

Q & A

  • What is the difference between vertical scaling and horizontal scaling?

    -Vertical scaling involves adding more resources like RAM or upgrading the CPU of a single server, which is easy but limited. Horizontal scaling, on the other hand, involves adding replicas of the server to handle subsets of requests, allowing for almost infinite scaling and redundancy without requiring high-end machines.

  • Why is a load balancer necessary in a horizontally scaled system?

    -A load balancer is needed to distribute incoming requests evenly across multiple servers, preventing any single server from being overloaded while others are underutilized. It also provides fault tolerance by ensuring that if one server fails, others can continue to handle requests.

  • What is a Content Delivery Network (CDN) and how does it work?

    -A CDN is a network of servers distributed worldwide that serves static files like images, videos, and sometimes HTML, CSS, and JavaScript files. It works by caching copies of files from the origin server onto CDN servers, which can be done on a push or pull basis, reducing latency and improving load times for users.

  • What is the purpose of caching in computer networks?

    -Caching is used to create copies of data so that it can be retrieved faster in the future. It reduces the need for repeated network requests, which can be expensive in terms of time and resources, by storing data at various levels, from browser cache to CPU cache.

  • How does the Domain Name System (DNS) translate domain names to IP addresses?

    -The DNS is a decentralized service that maps domain names to IP addresses using DNS records, such as the A record for address mapping. When a DNS query is made, the system uses these records to retrieve the corresponding IP address, which is then cached by the operating system to avoid repeated queries.

  • What is the main advantage of using HTTP over TCP for web browsing?

    -HTTP is an application-level protocol built on top of TCP that provides a higher level of abstraction, making it easier for developers to work with. It follows the client-server model and includes methods like GET and POST, which simplify the process of sending and receiving data over the internet without worrying about individual data packets.

  • What are the main differences between REST and GraphQL API patterns?

    -REST is a standardization for HTTP APIs that makes them stateless and follows consistent guidelines, using different HTTP status codes to indicate success or error. GraphQL, introduced by Facebook, allows clients to make a single request and specify exactly which resources they need, reducing over-fetching and the number of requests made.

  • How does gRPC differ from REST in terms of performance?

    -gRPC uses protocol buffers, which serialize data into a binary format that is more storage-efficient and faster to send over a network compared to JSON used in REST APIs. This results in a performance boost, especially for server-to-server communication.

  • What is the purpose of Websockets and how do they differ from HTTP?

    -Websockets provide bi-directional communication, allowing for real-time data transfer between a client and server. Unlike HTTP, which requires polling to check for new data, Websockets push updates immediately when new data is available, making them ideal for applications like chat apps.

  • Why are databases like MySQL and PostgreSQL preferred over storing data in text files?

    -Databases offer more efficient data storage using data structures like B-trees and allow for fast retrieval of data through SQL queries. They are also ACID-compliant, ensuring durability, isolation, atomicity, and consistency, which are crucial for maintaining data integrity.

  • What is the CAP theorem and how does it relate to database design?

    -The CAP theorem states that in the presence of a network partition, a database can only guarantee two out of three properties: consistency, availability, and partition tolerance. It helps database designers make trade-offs in replicated systems, often choosing between consistency and availability based on the system's requirements.

  • What is message queuing and how does it benefit a system with high data intake?

    -Message queuing involves using a system like a message queue to persist data before it can be processed, especially when the system receives more data than it can handle. This not only helps in managing data flow but also decouples different parts of an application, improving system architecture and reliability.

Outlines

00:00

πŸš€ Scaling Applications: Vertical vs. Horizontal Scaling

This paragraph introduces key concepts in system design, particularly focusing on scaling strategies for handling increased user load. It explains vertical scaling, which involves upgrading a single server’s resources, and contrasts it with horizontal scaling, where additional servers are added to distribute the load. The paragraph also highlights the importance of load balancers in horizontal scaling to ensure even distribution of requests and discusses the benefits of using content delivery networks (CDNs) for serving static files. Additionally, it briefly touches on caching mechanisms and the fundamentals of networking, such as IP addresses and TCP/IP protocols.

05:01

🌐 Understanding HTTP and API Patterns

This paragraph delves into the HTTP protocol and various API design patterns. It explains the client-server model and breaks down the components of an HTTP request into the header and body. The paragraph then introduces REST, a popular API pattern that emphasizes statelessness and consistent guidelines, and discusses how different HTTP status codes represent the outcome of requests. Other API patterns such as GraphQL, which allows more efficient data retrieval, and gRPC, which offers performance improvements through protocol buffers, are also covered. Additionally, WebSockets are mentioned as a solution for bi-directional communication, particularly useful in real-time applications like chat.

10:02

πŸ’Ύ Database Management: SQL, NoSQL, and Replication Strategies

This paragraph focuses on different database management approaches, starting with relational databases like SQL, which offer ACID compliance for data integrity. It then contrasts this with NoSQL databases, which are designed for horizontal scalability by dropping certain constraints like consistency. The paragraph also explores database scaling techniques such as sharding, which distributes data across multiple machines, and replication, where data is copied across different servers for redundancy and availability. It concludes by discussing the complexities of maintaining data consistency and availability in distributed systems, referencing the CAP theorem and PACELC theorem, and introduces message queues as a solution for handling large data streams.

Mindmap

Keywords

πŸ’‘Vertical Scaling

Vertical scaling refers to the process of increasing the capacity of a server by adding more resources such as RAM or upgrading the CPU. It is a straightforward method to scale up a system, but it has limitations as there is a physical maximum to how much a single server can be upgraded. In the video, it is mentioned as an initial approach to scaling an application, but it is later contrasted with horizontal scaling as a more limited option.

πŸ’‘Horizontal Scaling

Horizontal scaling is the practice of adding more servers or replicas to handle a growing number of requests, allowing for nearly infinite scalability. This method is more complex but offers redundancy and fault tolerance, as it eliminates the single point of failure present in vertical scaling. The video emphasizes the power of horizontal scaling in building scalable applications and introduces the concept of load balancers to manage traffic distribution among servers.

πŸ’‘Load Balancer

A load balancer is a server that acts as a reverse proxy and directs incoming network traffic to the appropriate server or service based on the load balancing algorithm used. It plays a crucial role in horizontal scaling by distributing client requests evenly across multiple servers, ensuring no single server becomes a bottleneck. The script mentions algorithms like round-robin and hashing as methods for load balancing.

πŸ’‘Content Delivery Network (CDN)

A Content Delivery Network is a distributed network of servers that deliver static files like images, videos, and web assets to users from the server closest to them. CDNs improve the performance and availability of web content by reducing latency and bandwidth usage. The video script explains how CDNs work by caching and distributing copies of data from the origin server to various geographical locations.

πŸ’‘Caching

Caching is a technique used to store copies of data temporarily in various levels of a system, from browser cache to CPU cache, to speed up data retrieval. The video script discusses caching in the context of network requests and system memory, highlighting its role in reducing the cost and time of fetching data.

πŸ’‘IP Address

An IP address is a unique identifier assigned to devices on a network, allowing them to communicate with each other. The video script touches on the importance of IP addresses in computer networking and how they are used in conjunction with the Internet Protocol Suite for data transmission.

πŸ’‘TCP/IP

TCP/IP, also known as the Internet Protocol Suite, is a set of communication protocols used for transmitting data over the internet. The video script explains that TCP ensures reliable data transmission by reordering and resending missing packets, which is why it is the foundation for many other protocols like HTTP and WebSockets.

πŸ’‘Domain Name System (DNS)

The Domain Name System is a decentralized service that translates human-readable domain names into IP addresses. The video script describes how DNS works, with the creation of A records to map domain names to server IP addresses, and the caching of these records by operating systems to reduce the need for frequent DNS queries.

πŸ’‘HTTP

HTTP, or Hypertext Transfer Protocol, is an application-level protocol used for transmitting hypermedia documents, such as HTML. The video script explains that HTTP operates on top of TCP and follows a client-server model, with requests and responses structured with headers and bodies. It also introduces different API patterns built on HTTP, such as REST and GraphQL.

πŸ’‘REST

REST, or Representational State Transfer, is an architectural style for designing networked applications, where APIs are stateless and follow uniform interface constraints. The video script mentions REST as a popular API pattern that uses HTTP methods and status codes to communicate the outcome of requests, with 200 indicating success and 400 or 500 indicating client or server errors, respectively.

πŸ’‘GraphQL

GraphQL is a query language for APIs and a runtime for executing those queries against data sources. Introduced by Facebook, it allows clients to request exactly the data they need, reducing over-fetching and under-fetching. The video script contrasts GraphQL with REST, highlighting its ability to fetch multiple resources in a single request.

πŸ’‘gRPC

gRPC is a high-performance RPC framework developed by Google, which uses protocol buffers for efficient, binary serialization of data. The video script describes gRPC as an improvement over REST APIs for server-to-server communication and mentions gRPC-web for browser support, emphasizing the performance benefits of using protocol buffers over JSON.

πŸ’‘WebSockets

WebSockets provide a full-duplex communication channel over a single, long-lived connection, allowing servers to push data to clients immediately as it becomes available. The video script explains how WebSockets solve the problem of real-time communication in applications like chat apps, where HTTP polling would be inefficient.

πŸ’‘SQL Database

SQL databases, or relational database management systems like MySQL and PostgreSQL, store data in a structured format using rows and tables. The video script discusses how SQL databases offer ACID compliance, ensuring data integrity and reliability, and contrasts them with NoSQL databases, which sacrifice some of these properties for scalability.

πŸ’‘NoSQL Database

NoSQL databases are non-relational databases that do not use traditional tables and are designed for horizontal scaling and flexibility in data models. The video script explains that NoSQL databases drop the consistency requirement of ACID and the concept of relations, allowing for different types of databases like key-value stores, document stores, and graph databases.

πŸ’‘Sharding

Sharding is a technique used to distribute data across multiple machines in a database to improve scalability. The video script describes sharding in the context of NoSQL databases, where a shard key determines the partitioning of data, allowing for horizontal scaling without the need for strict consistency.

πŸ’‘Replication

Replication in databases involves making copies of data to improve read scalability and provide redundancy. The video script discusses two types of replication: leader-follower, where all writes go to a leader and are then replicated to followers, and leader-leader, where every replica can handle reads and writes but may lead to inconsistency.

πŸ’‘CAP Theorem

The CAP theorem states that in the presence of a network partition, a distributed database can only guarantee two out of three desirable properties: Consistency, Availability, and Partition tolerance. The video script explains the trade-offs involved in replicated database design and mentions the more nuanced PACELC theorem as an alternative.

πŸ’‘Message Queue

A message queue is a tool used to decouple and asynchronously process data in a system. The video script describes how message queues can handle situations where data is being received faster than it can be processed, allowing for persistent storage before processing and enabling different parts of an application to operate independently.

Highlights

Scaling apps from a single server to handling more users involves vertical and horizontal scaling.

Vertical scaling is limited, while horizontal scaling allows for almost infinite scalability with load balancing.

Load balancers distribute traffic evenly among servers to prevent overload and add fault tolerance.

Content Delivery Networks (CDNs) serve static files globally to reduce latency.

Caching techniques like CDNs improve data retrieval speed and reduce network requests.

IP addresses uniquely identify devices on a network, essential for computer communication.

TCP/IP protocols, including TCP and UDP, govern data transmission over the Internet.

Domain Name System (DNS) translates domain names to IP addresses for website access.

HTTP is an application-level protocol built on top of TCP for client-server communication.

REST API pattern standardizes stateless HTTP APIs with consistent response codes.

GraphQL allows for fetching specific resources in a single request, reducing over-fetching.

gRPC is an RPC framework using Protocol Buffers for efficient binary data serialization.

WebSockets enable bi-directional communication for real-time applications like chat apps.

SQL databases provide efficient data storage and retrieval with ACID compliance.

NoSQL databases sacrifice consistency for horizontal scaling and flexibility.

Sharding is a technique for horizontal scaling of databases using a Shard key.

Replication creates read-only copies of databases to scale reads, with leader-follower and leader-leader models.

The CAP theorem highlights the trade-offs between consistency, availability, and partition tolerance in distributed systems.

Message queues provide durable storage and enable system decoupling for data processing.

System design involves complex methods for efficient data storage and movement.

neetcode.io offers courses for beginners and interview preparation in system design.

Transcripts

play00:00

do you want to level up from Junior Dev

play00:02

so that you can build scalable apps or

play00:05

maybe get a 100K pay Bump by passing

play00:07

your system design interview round well

play00:09

you're gonna need a box of neat codes 20

play00:12

essential system Design Concepts which

play00:14

include networking API patterns

play00:17

databases and more all of which are

play00:19

covered more extensively on neetcode.io

play00:21

to start let's say you have a single

play00:24

server which is accepting and fulfilling

play00:26

requests for your application but now

play00:29

we're getting more users so we need to

play00:31

scale it the easiest thing to do would

play00:33

be to add more resources like Ram or

play00:35

maybe upgrade your CPU this is known as

play00:38

vertical scaling it's pretty easy but

play00:41

it's very limited a better approach

play00:43

would be to add replicas so that each

play00:45

server can handle a subset of requests

play00:48

this is known as horizontal scaling it's

play00:51

more powerful because we can almost

play00:53

scale infinitely and we don't even need

play00:55

good machines it also adds redundancy

play00:58

and fault tolerance because if one of

play01:01

our servers goes down all of the other

play01:03

servers can continue to fulfill requests

play01:06

this eliminates our previous single

play01:08

point of failure but the downside is

play01:10

that this approach is much more

play01:12

complicated first of all how do we

play01:14

ensure that one server won't get

play01:16

overloaded while the others sit idle

play01:19

well for that we'll need a load balancer

play01:21

which is just a server known as a

play01:24

reverse proxy it directs incoming

play01:26

requests to the appropriate server so we

play01:29

can use an algorithm like round robin

play01:31

which will balance traffic by cycling

play01:33

through our pool of servers or we could

play01:36

go with another approach like hashing

play01:38

the incoming request ID in our case the

play01:41

goal is to even the amount of traffic

play01:43

each server is getting but if our

play01:46

servers are located all around the world

play01:48

we could even use a load balancer to

play01:50

route a request to the nearest location

play01:52

which brings us to content delivery

play01:55

networks if you're just serving static

play01:58

files like images videos and sometimes

play02:01

even HTML CSS and JavaScript files you

play02:04

can just use a CDN it's a network of

play02:07

servers located all around the world

play02:10

cdns don't really run any application

play02:13

logic they work by taking files hosted

play02:15

on your server aka the origin server and

play02:19

copying them onto the CDN servers this

play02:22

can be done either on a push or pull

play02:24

basis but cdns are just one technique

play02:28

for caching which is all about creating

play02:31

copies of data so that it can be

play02:33

refetched faster in the future making

play02:36

Network requests can be expensive so our

play02:38

browsers will sometimes cache data onto

play02:41

our disk but reading disk can be

play02:43

expensive so our computers will copy it

play02:46

into memory but reading memory can be

play02:48

expensive so our operating systems will

play02:51

copy a subset of it into our L1 L2 or L3

play02:55

CPU cache but how do computers

play02:58

communicate with each other well well

play03:00

every computer is assigned an IP address

play03:03

which uniquely identifies a device on a

play03:06

network and to round it all out we have

play03:08

the poorly named TCP slash IP or the

play03:12

Internet Protocol Suite since it

play03:14

actually includes UDP as well what but

play03:17

focusing on TCP for a second there has

play03:20

to be some set of rules AKA protocols

play03:24

that decide how we send data over the

play03:27

Internet just like how in real life we

play03:29

have a system that decides how we send

play03:31

mail to each other usually when we send

play03:34

data like files they're broken down into

play03:37

individual packets and they're sent over

play03:40

the internet and when they arrive at the

play03:42

destination the packets are numbered so

play03:44

that they can be reassembled in the same

play03:47

order if some packets are missing TCP

play03:50

ensures that they'll be resent this is

play03:52

what makes it a reliable protocol and

play03:54

why many other protocols like HTTP and

play03:57

websockets are built on top of TCP but

play04:01

when you type neetcode.io into your

play04:03

search bar how does your computer know

play04:05

which IP address it belongs to well for

play04:08

that we have the domain name system

play04:10

which is a largely decentralized service

play04:13

that works to translate a domain to its

play04:16

IP address when you buy a domain from a

play04:19

DNS registrar you can create a dnsa

play04:22

record which stands for address and then

play04:25

you can enter the IP address of your

play04:27

server so then when you search and your

play04:30

computer makes a DNS query to get the IP

play04:33

address it'll use the a record mapping

play04:35

to get the address and then your

play04:37

operating system will cache it so that

play04:39

it doesn't need to make a DNS query

play04:41

every single time but wait a minute why

play04:44

do we usually use HTTP to view websites

play04:47

well TCP is too low level we don't want

play04:51

to have to worry about individual data

play04:53

packets so we have an application Level

play04:56

protocol like HTTP which is what

play04:59

developers like like you and I actually

play05:01

use on a day-to-day basis it follows the

play05:04

client server model where a client will

play05:06

initiate a request which includes two

play05:09

parts one the request header think of

play05:12

that as the shipping label you put on a

play05:14

package it tells you where the package

play05:16

is going who it's from and maybe some

play05:19

other metadata about the package itself

play05:21

the second part is the request body

play05:24

which is basically the package contents

play05:27

to test it out just open your Dev tools

play05:30

Network Tab and click subscribe go on

play05:32

always taking a closer look at the

play05:34

request we can see that the response

play05:36

also includes a header as well as a body

play05:40

but even with HTTP there are multiple

play05:43

API patterns we could follow the most

play05:45

popular one being rest which is a

play05:48

standardization around HTTP apis making

play05:51

them stateless and following consistent

play05:53

guidelines like a successful request

play05:56

should include a 200 code in its

play05:58

response header whereas a bad request

play06:01

from the client would return a 400 code

play06:03

and an issue with the server would

play06:06

result in a 500 level code graphql is

play06:09

another API pattern introduced by

play06:11

Facebook in 2015. the idea is that

play06:14

instead of making another request for

play06:16

every single resource on your server

play06:18

like you would do with rest with graphql

play06:21

you can just make a single request AKA a

play06:24

query and you can choose exactly which

play06:26

resources you want to fetch this means

play06:29

you can fetch multiple resources with a

play06:31

single request and you also don't end up

play06:33

over fetching any data that's not

play06:35

actually needed another API pattern is

play06:38

grpc though it's really considered a

play06:41

framework released by Google in 2016 it

play06:44

was also meant to be an improvement over

play06:46

rest apis it's an RPC framework mainly

play06:50

used for server-to-server communication

play06:52

but there's also grpc web which allows

play06:55

using grpc from a browser which has also

play06:58

been growing quickly over the last few

play07:00

years the performance boost comes from

play07:02

protocol buffers comparing them to Json

play07:05

which is what rest apis use protocol

play07:08

buffers are an improvement in that data

play07:10

is serialized into a binary format which

play07:12

is usually more storage efficient and of

play07:15

course sending less data over a network

play07:17

will usually be faster the downside is

play07:19

that Json is a lot more human readable

play07:22

since it's just plain text another app

play07:24

layer protocol is websockets to

play07:27

understand the main problem that it

play07:29

solves let's take chat apps for example

play07:31

usually when someone sends you a message

play07:34

you receive it immediately if we were to

play07:36

implement this with HTTP we would have

play07:39

to use polling where we would

play07:40

periodically make a request to check if

play07:43

there was a new message available for us

play07:45

but unlike HTTP 1 websockets support

play07:48

bi-directional communication so when you

play07:51

get a new message it's immediately

play07:53

pushed to your device and whenever you

play07:55

send a message it's immediately pushed

play07:57

to the receiver's device and for

play08:00

actually storing data we have SQL or

play08:03

relational database Management Systems

play08:05

like MySQL and postgres but why should

play08:08

we use a database when we can just store

play08:10

everything in text files stored on disk

play08:13

well with databases we can more

play08:14

efficiently store data using data

play08:16

structures like B trees and we have fast

play08:19

retrieval of data using SQL queries

play08:22

since data is organized into rows and

play08:25

tables relational database Management

play08:27

systems are usually acid compliant which

play08:30

means that they offer durability because

play08:32

data is stored on disk so even if a

play08:35

machine restarts the data will still be

play08:37

there isolation means that different

play08:39

concurrent transactions won't interfere

play08:42

with each other atomicity means that

play08:45

every transaction is All or Nothing

play08:47

lastly we have consistency which means

play08:50

that foreign key and other constraints

play08:53

will always be enforced this one is

play08:55

really important because it led to the

play08:57

creation of nosql or non-relational

play09:00

databases consistency makes databases

play09:04

harder to scale so no SQL databases drop

play09:07

this constraint and the whole idea of

play09:10

relations all together there are many

play09:12

types of nosql databases but popular

play09:14

ones include key value stores document

play09:17

stores and graph databases but going

play09:20

back to consistency for a second if we

play09:23

don't have to enforce any foreign key

play09:25

constraints that means we can break up

play09:27

our database and scale it horizontally

play09:30

with different machines this technique

play09:32

is called sharding but how do we decide

play09:34

which portion of the data to put on

play09:36

which machine well for that we usually

play09:39

have a Shard key so given a table of

play09:42

people our Shard key could be the ID of

play09:45

the person but sharding can get

play09:47

complicated a simpler approach is

play09:49

replication if we want to scale our

play09:52

database reads we can make read-only

play09:54

copies of our database this is called

play09:56

leader follower replication wherever

play09:59

every right will get sent to the leader

play10:01

who sends those to the followers but

play10:04

every read could go to a leader or a

play10:06

follower there's also leader leader

play10:09

replication where every replica can be

play10:11

used to read or write but this can

play10:13

result in inconsistent data so it would

play10:16

be best to use it where you can have a

play10:18

replica for every region in the world

play10:20

for example it can be complex to keep

play10:22

replicas in sync so the cap theorem was

play10:25

created to weigh trade-offs with

play10:27

replicated design it states that given a

play10:30

network partition in a database as

play10:32

database designers we can only choose to

play10:35

favor either data consistency or data

play10:38

availability what makes it confusing is

play10:41

that consistency here means something

play10:43

different than with acid it's a somewhat

play10:45

controversial theorem which is why the

play10:48

more complete pack else theorem was

play10:50

created lastly we have message cues

play10:53

they're kind of like databases because

play10:55

they have durable storage and they can

play10:57

be replicated for redundancy see or

play11:00

sharded for scalability but they have

play11:02

many use cases if our system was

play11:04

receiving more data than it can process

play11:07

it would be good to introduce a message

play11:09

queue so that our data can be persisted

play11:12

before we're able to process it in doing

play11:14

so we also get the added benefit that

play11:16

different parts of our app can become

play11:18

decoupled and if you've learned anything

play11:20

by now it's that software engineering is

play11:23

all about finding new and complicated

play11:25

ways to store and move data around if

play11:28

you want to learn more you can check out

play11:30

my system design for beginners course on

play11:32

neetcode.io as well as my system design

play11:35

interview course thank you for

play11:37

supporting my work and I'll see you soon

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
System DesignInterview PrepAPI PatternsDatabasesScalingLoad BalancingCDNCachingNetworkingHTTPWebSockets