This week’s system design refresher:
ACID Properties in Databases With Examples (Youtube video)
Have you heard of the 12-Factor App?
What does API gateway do?
How does Redis architecture evolve?
Cloud Cost Reduction Techniques
SPONSOR US
Engineering leaders need to know—and be able to show—that their teams:
Deliver operational excellence
Drive business impact
The best way to achieve those results is by setting clear, data-backed goals and working to accomplish them. In this free guide, we walk you through how to actively improve your team’s outcomes by leveraging metrics program data, resource allocation visibility, and workflow automation. You'll also learn to audience-tailor reporting and deliver updates confidently—setting you up for continued success in your role, and in your career.
Download Your Guide Now
ACID Properties in Databases With Examples
Have you heard of the 12-Factor App?
The "12 Factor App" offers a set of best practices for building modern software applications. Following these 12 principles can help developers and teams in building reliable, scalable, and manageable applications.
Here's a brief overview of each principle:
Codebase:
Have one place to keep all your code, and manage it using version control like Git.
Dependencies:
List all the things your app needs to work properly, and make sure they're easy to install.
Config:
Keep important settings like database credentials separate from your code, so you can change them without rewriting code.
Backing Services:
Use other services (like databases or payment processors) as separate components that your app connects to.
Build, Release, Run:
Make a clear distinction between preparing your app, releasing it, and running it in production.
Processes:
Design your app so that each part doesn't rely on a specific computer or memory. It's like making LEGO blocks that fit together.
Port Binding:
Let your app be accessible through a network port, and make sure it doesn't store critical information on a single computer.
Concurrency:
Make your app able to handle more work by adding more copies of the same thing, like hiring more workers for a busy restaurant.
Disposability:
Your app should start quickly and shut down gracefully, like turning off a light switch instead of yanking out the power cord.
Dev/Prod Parity:
Ensure that what you use for developing your app is very similar to what you use in production, to avoid surprises.
Logs:
Keep a record of what happens in your app so you can understand and fix issues, like a diary for your software.
Admin Processes:
Run special tasks separately from your app, like doing maintenance work in a workshop instead of on the factory floor.
Over to you: Where do you think these principles can have the most impact in improving software development practices?
Latest articles
If you’re not a paid subscriber, here’s what you missed this month.
A Crash Course in IPv4 Addressing
A Brief History of Scaling Netflix
15 Open-Source Projects That Changed the World
The Top 3 Resume Mistakes Costing You the Job
How Video Recommendations Work - Part 1
To receive all the full articles and support ByteByteGo, consider subscribing:
What does API gateway do?
The diagram below shows the detail.
Step 1 - The client sends an HTTP request to the API gateway.
Step 2 - The API gateway parses and validates the attributes in the HTTP request.
Step 3 - The API gateway performs allow-list/deny-list checks.
Step 4 - The API gateway talks to an identity provider for authentication and authorization.
Step 5 - The rate limiting rules are applied to the request. If it is over the limit, the request is rejected.
Steps 6 and 7 - Now that the request has passed basic checks, the API gateway finds the relevant service to route to by path matching.
Step 8 - The API gateway transforms the request into the appropriate protocol and sends it to backend microservices.
Steps 9-12: The API gateway can handle errors properly, and deals with faults if the error takes a longer time to recover (circuit break). It can also leverage ELK (Elastic-Logstash-Kibana) stack for logging and monitoring. We sometimes cache data in the API gateway.
Over to you:
What’s the difference between a load balancer and an API gateway?
Do we need to use different API gateways for PC, mobile and browser separately?
How does Redis architecture evolve?
Redis is a popular in-memory cache. How did it evolve to the architecture it is today?
2010 - Standalone Redis
When Redis 1.0 was released in 2010, the architecture was quite simple. It is usually used as a cache to the business application.
However, Redis stores data in memory. When we restart Redis, we will lose all the data and the traffic directly hits the database.
2013 - Persistence
When Redis 2.8 was released in 2013, it addressed the previous restrictions. Redis introduced RDB in-memory snapshots to persist data. It also supports AOF (Append-Only-File), where each write command is written to an AOF file.
2013 - Replication
Redis 2.8 also added replication to increase availability. The primary instance handles real-time read and write requests, while replica synchronizes the primary's data.
2013 - Sentinel
Redis 2.8 introduced Sentinel to monitor the Redis instances in real time. is a system designed to help managing Redis instances. It performs the following four tasks: monitoring, notification, automatic failover and configuration provider.
2015 - Cluster
In 2015, Redis 3.0 was released. It added Redis clusters.
A Redis cluster is a distributed database solution that manages data through sharding. The data is divided into 16384 slots, and each node is responsible for a portion of the slot.
Looking Ahead
Redis is popular because of its high performance and rich data structures that dramatically reduce the complexity of developing a business application.
In 2017, Redis 5.0 was released, adding the stream data type.
In 2020, Redis 6.0 was released, introducing the multi-threaded I/O in the network module. Redis model is divided into the network module and the main processing module. The Redis developers the network module tends to become a bottleneck in the system.
Over to you - have you used Redis before? If so, for what use case?
Cloud Cost Reduction Techniques
Irrational Cloud Cost is the biggest challenge many organizations are battling as they navigate the complexities of cloud computing.
Efficiently managing these costs is crucial for optimizing cloud usage and maintaining financial health.
The following techniques can help businesses effectively control and minimize their cloud expenses.
Reduce Usage:
Fine-tune the volume and scale of resources to ensure efficiency without compromising on the performance of applications (e.g., downsizing instances, minimizing storage space, consolidating services).
Terminate Idle Resources:
Locate and eliminate resources that are not in active use, such as dormant instances, databases, or storage units.
Right Sizing:
Adjust instance sizes to adequately meet the demands of your applications, ensuring neither underuse nor overuse.
Shutdown Resources During Off-Peak Times:
Set up automatic mechanisms or schedules for turning off non-essential resources when they are not in use, especially during low-activity periods.
Reserve to Reduce Rate:
Adopt cost-effective pricing models like Reserved Instances or Savings Plans that align with your specific workload needs.
Bonus Tip: Consider using Spot Instances and lower-tier storage options for additional cost savings.
Optimize Data Transfers:
Utilize methods such as data compression and Content Delivery Networks (CDNs) to cut down on bandwidth expenses, and strategically position resources to reduce data transfer costs, focusing on intra-region transfers.
Over to you: Which technique fits in well with your current cloud infra setup?
SPONSOR US
Get your product in front of more than 500,000 tech professionals.
Our newsletter puts your products and services directly in front of an audience that matters - hundreds of thousands of engineering leaders and senior engineers - who have influence over significant tech decisions and big purchases.
Space Fills Up Fast - Reserve Today
Ad spots typically sell out about 4 weeks in advance. To ensure your ad reaches this influential audience, reserve your space now by emailing hi@bytebytego.com.