In this issue, we will cover:
Why is Nginx called a “reverse” proxy?
CAP theorem
How Does Live Streaming Platform Work?
CDN
Postman the API platform for building and using APIs (sponsored)
Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster. The platform is cloud-native and includes the comprehensive suite of features enterprises are looking for, including SSO, audit, platform security, and much more.
API repository
Postman can store and manage API specifications, documentation, workflow recipes, test cases and results, metrics, and everything else related to APIs.
Workspaces
Postman workspaces are collaborative places where teams gather and solve problems. Every person in a workspace sees the same API tools, collections, and environments, which are updated in real-time.
API lifecycle
The Postman platform includes a comprehensive set of tools that help accelerate the API lifecycle—from design, testing, documentation, and mocking to the sharing and discoverability of your APIs.
Governance
Postman's full-lifecycle approach to governance lets adopters shift left in their development practices, producing better-quality APIs and fostering collaboration between developer and API design teams.
Why is Nginx called a “reverse” proxy?
The diagram below shows the differences between a forward proxy and a reverse proxy.
A forward proxy is a server that sits between user devices and the internet.
A forward proxy is commonly used for:
Protect clients
Avoid browsing restrictions
Block access to certain content
A reverse proxy is a server that accepts a request from the client, forwards the request to web servers, and returns the results to the client as if the proxy server had processed the request.
A reverse proxy is good for:
Protect servers
Load balancing
Cache static contents
Encrypt and decrypt SSL communications
CAP theorem: one of the most misunderstood terms
The CAP theorem is one of the most famous terms in computer science, but I bet different developers have different understandings. Let’s examine what it is and why it can be confusing.
CAP theorem states that a distributed system can't provide more than two of these three guarantees simultaneously.
Consistency: consistency means all clients see the same data at the same time no matter which node they connect to.
Availability: availability means any client which requests data gets a response even if some of the nodes are down.
Partition Tolerance: a partition indicates a communication break between two nodes. Partition tolerance means the system continues to operate despite network partitions.
The “2 of 3” formulation can be useful, but this simplification could be misleading.
Picking a database is not easy. Justifying our choice purely based on the CAP theorem is not enough. For example, companies don't choose Cassandra for chat applications simply because it is an AP system. There is a list of good characteristics that make Cassandra a desirable option for storing chat messages. We need to dig deeper.
“CAP prohibits only a tiny part of the design space: perfect availability and consistency in the presence of partitions, which are rare”. Quoted from the paper: CAP Twelve Years Later: How the “Rules” Have Changed.
The theorem is about 100% availability and consistency. A more realistic discussion would be the trade-offs between latency and consistency when there is no network partition. See PACELC theorem for more details.
Is the CAP theorem really useful?
I think it is still useful as it opens our minds to a set of tradeoff discussions, but it is only part of the story. We need to dig deeper when picking the right database.
How Does Live Streaming Platform Work?
(YouTube live, Twitch, TikTok Live)
CDN
What is CDN (Content Delivery Network)? How does CDN make content delivery faster?
The diagram below shows why.
A CDN refers to geographically distributed servers (also called edge servers) that provide fast delivery of static and dynamic content.
With CDN, users don’t need to retrieve content (music, video, files, pictures, etc.) from the origin server. Instead, the content is cached at CDN nodes around the globe, and users can retrieve the content from nearby CDN nodes.
The benefits of CDN are:
Reducing latency
Reducing bandwidth
Improving website security, especially protecting against DDoS (Distributed Denial-of-Service) attack
Increasing content availability
Great content. Keep it up! Im loving it
Nice short post on forward and reverse proxy.