From 2c288234660a0d3f208bc55532af11c3fd236bd2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:26:52 +0100 Subject: [PATCH] chore: sync content to repo (#9668) Co-authored-by: kamranahmedse <4921183+kamranahmedse@users.noreply.github.com> --- .../content/cache-aside@bffJlvoLHFldS0CluWifP.md | 12 +++++++++--- .../domain-name-system@Uk6J8JRcKVEFz4_8rLfnQ.md | 8 ++++---- .../message-queues@37X1_9eCmkZkz5RDudE5N.md | 5 ----- .../sql-vs-nosql@KLnpMR2FxlQkCHZP6-tZm.md | 2 +- .../content/tcp@2nF5uC6fYKbf0RFgGNHiP.md | 16 +--------------- 5 files changed, 15 insertions(+), 28 deletions(-) diff --git a/src/data/roadmaps/system-design/content/cache-aside@bffJlvoLHFldS0CluWifP.md b/src/data/roadmaps/system-design/content/cache-aside@bffJlvoLHFldS0CluWifP.md index f8ecea50a..1b7bb685d 100644 --- a/src/data/roadmaps/system-design/content/cache-aside@bffJlvoLHFldS0CluWifP.md +++ b/src/data/roadmaps/system-design/content/cache-aside@bffJlvoLHFldS0CluWifP.md @@ -10,10 +10,16 @@ The application is responsible for reading and writing from storage. The cache d * Return entry - def get\_user(self, user\_id): user = cache.get("user.{0}", user\_id) if user is None: user = db.query("SELECT \* FROM users WHERE user\_id = {0}", user\_id) if user is not None: key = "user.{0}".format(user\_id) cache.set(key, json.dumps(user)) return user + def get_user(self, user_id): + user = cache.get("user.{0}", user_id) + if user is None: + user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id) + if user is not None: + key = "user.{0}".format(user_id) + cache.set(key, json.dumps(user)) + return user - -[Memcached](https://memcached.org/) is generally used in this manner. Subsequent reads of data added to cache are fast. Cache-aside is also referred to as lazy loading. Only requested data is cached, which avoids filling up the cache with data that isn't requested. +[Memcached](https://memcached.org/) is generally used in this manner. Subsequent reads of data added to cache are fast. Cache-aside is also referred to as lazy loading. Only the requested data is cached, which avoids filling up the cache with data that isn't requested. ![Cache Aside](https://i.imgur.com/Ujf0awN.png) diff --git a/src/data/roadmaps/system-design/content/domain-name-system@Uk6J8JRcKVEFz4_8rLfnQ.md b/src/data/roadmaps/system-design/content/domain-name-system@Uk6J8JRcKVEFz4_8rLfnQ.md index ed28fa7f6..5d3ff66f2 100644 --- a/src/data/roadmaps/system-design/content/domain-name-system@Uk6J8JRcKVEFz4_8rLfnQ.md +++ b/src/data/roadmaps/system-design/content/domain-name-system@Uk6J8JRcKVEFz4_8rLfnQ.md @@ -11,14 +11,14 @@ DNS is hierarchical, with a few authoritative servers at the top level. Your rou Services such as [CloudFlare](https://www.cloudflare.com/dns/) and [Route53](https://aws.amazon.com/route53/) provide managed DNS services. Some DNS services can route traffic through various methods: -* [@article@Weighted Round Robin](https://www.jscape.com/blog/load-balancing-algorithms) * Prevent traffic from going to servers under maintenance * Balance between varying cluster sizes * A/B testing -* [@article@Latency Based](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-latency) -* [@article@Geolocation Based](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-geo) Visit the following resources to learn more: - [@opensource@Getting started with Domain Name System](https://github.com/donnemartin/system-design-primer#domain-name-system) -- [@article@What is DNS?](https://www.cloudflare.com/learning/dns/what-is-dns/) \ No newline at end of file +- [@article@What is DNS?](https://www.cloudflare.com/learning/dns/what-is-dns/) +- [@article@Latency Based](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-latency) +- [@article@Geolocation Based](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-geo) +- [@article@Weighted Round Robin](https://www.jscape.com/blog/load-balancing-algorithms) \ No newline at end of file diff --git a/src/data/roadmaps/system-design/content/message-queues@37X1_9eCmkZkz5RDudE5N.md b/src/data/roadmaps/system-design/content/message-queues@37X1_9eCmkZkz5RDudE5N.md index 1c94497c3..3f5971ded 100644 --- a/src/data/roadmaps/system-design/content/message-queues@37X1_9eCmkZkz5RDudE5N.md +++ b/src/data/roadmaps/system-design/content/message-queues@37X1_9eCmkZkz5RDudE5N.md @@ -7,11 +7,6 @@ Message queues receive, hold, and deliver messages. If an operation is too slow The user is not blocked and the job is processed in the background. During this time, the client might optionally do a small amount of processing to make it seem like the task has completed. For example, if posting a tweet, the tweet could be instantly posted to your timeline, but it could take some time before your tweet is actually delivered to all of your followers. -* [@article@Redis](https://redis.io/) is useful as a simple message broker but messages can be lost. -* [@article@RabbitMQ](https://www.rabbitmq.com/) is popular but requires you to adapt to the 'AMQP' protocol and manage your own nodes. -* [@article@AWS SQS](https://aws.amazon.com/sqs/) is hosted but can have high latency and has the possibility of messages being delivered twice. -* [@article@Apache Kafka](https://kafka.apache.org/) is a distributed event store and stream-processing platform. - Visit the following resources to learn more: - [@article@What is Redis?](https://redis.io/) diff --git a/src/data/roadmaps/system-design/content/sql-vs-nosql@KLnpMR2FxlQkCHZP6-tZm.md b/src/data/roadmaps/system-design/content/sql-vs-nosql@KLnpMR2FxlQkCHZP6-tZm.md index 8ce0b2277..32cec18b0 100644 --- a/src/data/roadmaps/system-design/content/sql-vs-nosql@KLnpMR2FxlQkCHZP6-tZm.md +++ b/src/data/roadmaps/system-design/content/sql-vs-nosql@KLnpMR2FxlQkCHZP6-tZm.md @@ -4,7 +4,7 @@ SQL databases, such as MySQL and PostgreSQL, are best suited for structured, rel NoSQL databases, such as MongoDB and Cassandra, are best suited for unstructured, non-relational data and use a flexible schema. They provide high scalability and performance for large amounts of data and are often used in big data and real-time web applications. -The choice between SQL and NoSQL depends on the specific use case and requirements of the project. If you need to store and query structured data with complex relationships, a SQL database is likely a better choice. If you need to store and query large amounts of unstructured data with high scalability and performance, a NoSQL database may be a better choice. +The choice between SQL and NoSQL depends on the specific use case and requirements of the project. If you need to store and query structured data with complex relationships, an SQL database is likely a better choice. If you need to store and query large amounts of unstructured data with high scalability and performance, a NoSQL database may be a better choice. Visit the following resources to learn more: diff --git a/src/data/roadmaps/system-design/content/tcp@2nF5uC6fYKbf0RFgGNHiP.md b/src/data/roadmaps/system-design/content/tcp@2nF5uC6fYKbf0RFgGNHiP.md index 71c6106dd..7244be67f 100644 --- a/src/data/roadmaps/system-design/content/tcp@2nF5uC6fYKbf0RFgGNHiP.md +++ b/src/data/roadmaps/system-design/content/tcp@2nF5uC6fYKbf0RFgGNHiP.md @@ -1,20 +1,6 @@ # TCP -TCP is a connection-oriented protocol over an [IP network](https://en.wikipedia.org/wiki/Internet_Protocol). Connection is established and terminated using a [handshake](https://en.wikipedia.org/wiki/Handshaking). All packets sent are guaranteed to reach the destination in the original order and without corruption through: - -* Sequence numbers and [checksum fields](https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Checksum_computation) for each packet -* [@article@Acknowledgement](https://en.wikipedia.org/wiki/Acknowledgement_\(data_networks\)) packets and automatic retransmission - -If the sender does not receive a correct response, it will resend the packets. If there are multiple timeouts, the connection is dropped. TCP also implements [flow control](https://en.wikipedia.org/wiki/Flow_control_\(data\)) and congestion control. These guarantees cause delays and generally result in less efficient transmission than UDP. - -To ensure high throughput, web servers can keep a large number of TCP connections open, resulting in high memory usage. It can be expensive to have a large number of open connections between web server threads and say, a [memcached server](https://memcached.org/). [Connection pooling](https://en.wikipedia.org/wiki/Connection_pool) can help in addition to switching to UDP where applicable. - -TCP is useful for applications that require high reliability but are less time critical. Some examples include web servers, database info, SMTP, FTP, and SSH. - -Use TCP over UDP when: - -* You need all of the data to arrive intact -* You want to automatically make a best estimate use of the network throughput +TCP (Transmission Control Protocol) is a connection-oriented, reliable, and ordered protocol used for transmitting data over an IP network. It establishes a connection between a sender and receiver before data transfer begins, ensures that data packets arrive in the correct sequence without errors, and provides mechanisms for retransmission of lost packets and flow control to manage network congestion. Visit the following resources to learn more: