EP105: The 12 Factor App

EP105: The 12 Factor App

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 How-to Guide: Effective Goals and Reporting for Software Teams (Sponsored)
͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­
Forwarded this email? Subscribe here for more

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


How-to Guide: Effective Goals and Reporting for Software Teams (Sponsored)

Engineering leaders need to know—and be able to show—that their teams:

  1. Deliver operational excellence

  2. 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.

No alternative text description for this image

Here's a brief overview of each principle:

  1. Codebase:
    Have one place to keep all your code, and manage it using version control like Git.

  2. Dependencies:
    List all the things your app needs to work properly, and make sure they're easy to install.

  3. Config:
    Keep important settings like database credentials separate from your code, so you can change them without rewriting code.

  4. Backing Services:
    Use other services (like databases or payment processors) as separate components that your app connects to.

  5. Build, Release, Run:
    Make a clear distinction between preparing your app, releasing it, and running it in production.

  6. 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.

  7. Port Binding:
    Let your app be accessible through a network port, and make sure it doesn't store critical information on a single computer.

  8. 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.

  9. Disposability:
    Your app should start quickly and shut down gracefully, like turning off a light switch instead of yanking out the power cord.

  10. Dev/Prod Parity:
    Ensure that what you use for developing your app is very similar to what you use in production, to avoid surprises.

  11. Logs:
    Keep a record of what happens in your app so you can understand and fix issues, like a diary for your software.

  12. 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.

  1. A Crash Course in IPv4 Addressing

  2. A Brief History of Scaling Netflix

  3. 15 Open-Source Projects That Changed the World

  4. The Top 3 Resume Mistakes Costing You the Job

  5. 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.

No alt text provided for this image

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:

  1. What’s the difference between a load balancer and an API gateway?

  2. 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?

No alt text provided for this image
  • 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.

No alt text provided for this image
  1. 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).

  2. Terminate Idle Resources:
    Locate and eliminate resources that are not in active use, such as dormant instances, databases, or storage units.

  3. Right Sizing:
    Adjust instance sizes to adequately meet the demands of your applications, ensuring neither underuse nor overuse.

  4. 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.

  5. 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.

  6. 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.

 
Like
Comment
Restack
 

© 2024 ByteByteGo
548 Market Street PMB 72296, San Francisco, CA 94104
Unsubscribe

Get the appStart writing


by "ByteByteGo" <bytebytego@substack.com> - 11:36 - 30 Mar 2024