ByteByteGo 2024年07月11日
EP119: What do Amazon, Netflix, and Uber have in common?
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文介绍了数据库扩容的七个关键策略,并探讨了系统功能测试的最佳方法。通过分析Amazon、Netflix和Uber的共通之处,阐述了如何高效扩展系统以应对增长需求,同时,文章还详细介绍了Figma如何实现Postgres数据库的100倍扩容,以及各种测试方式确保系统稳定性和性能。

🚀 无状态服务:设计无状态服务,使其不依赖特定服务器数据,易于扩展。

🌐 水平扩展:增加服务器数量,分担工作负载。

🎯 负载均衡:使用负载均衡器,将请求均匀分配到多个服务器。

🔄 自动扩展:实施自动扩展策略,根据实时流量调整资源。

🗄️ 缓存:利用缓存减少数据库负载,高效处理重复请求。

📤 数据库复制:跨多个节点复制数据,扩展读取操作并提高冗余。

🔗 数据库分片:将数据分布到多个实例,扩展读写操作。

🕰️ 异步处理:将耗时的任务移至后台工作进程,以扩展新请求的处理。

This week’s system design refresher:


Monitor AI Applications Built with NVIDIA NIM (Sponsored)

New Relic and NVIDIA released the first observability integration making it easy for companies to monitor the health and performance of their AI applications built with NVIDIA NIM.

Key features and use cases for AI monitoring include:

Get started


7 Must-know Strategies to Scale Your Database


What do Amazon, Netflix, and Uber have in common?

They are extremely good at scaling their system whenever needed.

Here are 8 must-know strategies to scale your system.

    Stateless Services
    Design stateless services because they don’t rely on server-specific data and are easier to scale.

    Horizontal Scaling
    Add more servers so that the workload can be shared.

    Load Balancing
    Use a load balancer to distribute incoming requests evenly across multiple servers.

    Auto Scaling
    Implement auto-scaling policies to adjust resources based on real-time traffic.

    Caching
    Use caching to reduce the load on the database and handle repetitive requests at scale.

    Database Replication
    Replicate data across multiple nodes to scale the read operations while improving redundancy.

    Database Sharding
    Distribute data across multiple instances to scale the writes as well as reads.

    Async Processing
    Move time-consuming and resource-intensive tasks to background workers using async processing to scale out new requests.

Over to you: Which other strategies have you used?


Latest articles

If you’re not a paid subscriber, here’s what you missed.

    A Crash Course in Database Scaling Strategies

    A Crash Course in Database Sharding

    A Crash Course on Microservice Communication Patterns

    A Crash Course on Cell-based Architecture

    A Crash Course on Content-Delivery Networks (CDN)

To receive all the full articles and support ByteByteGo, consider subscribing:

Subscribe now


100X Postgres Scaling at Figma

With 3 million monthly users, Figma’s user base has increased by 200% since 2018.

As a result, its Postgres database witnessed a whopping 100X growth.

    Vertical Scaling and Replication
    Figma used a single, large Amazon RDS database.

    As a first step, they upgraded to the largest instance available (from r5.12xlarge to r5.24xlarge).

    They also created multiple read replicas to scale read traffic and added PgBouncer as a connection pooler to limit the impact of a growing number of connections.

    Vertical Partitioning
    The next step was vertical partitioning.

    They migrated high-traffic tables like “Figma Files” and “Organizations” into their separate databases.

    Multiple PgBouncer instances were used to manage the connections for these separate databases.

    Horizontal Partitioning
    Over time, some tables crossed several terabytes of data and billions of rows.

    Postgres Vacuum became an issue and max IOPS exceeded the limits of Amazon RDS at the time.

    To solve this, Figma implemented horizontal partitioning by splitting large tables across multiple physical databases.

    A new DBProxy service was built to handle routing and query execution.

Over to you - Would you have done something differently?


Best ways to test system functionality

Testing system functionality is a crucial step in software development and engineering processes.

It ensures that a system or software application performs as expected, meets user requirements, and operates reliably.

Here we delve into the best ways:

    Unit Testing: Ensures individual code components work correctly in isolation.

    Integration Testing: Verifies that different system parts function seamlessly together.

    System Testing: Assesses the entire system's compliance with user requirements and performance.

    Load Testing: Tests a system's ability to handle high workloads and identifies performance issues.

    Error Testing: Evaluates how the software handles invalid inputs and error conditions.

    Test Automation: Automates test case execution for efficiency, repeatability, and error reduction.

Over to you:


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

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

数据库扩容 系统测试 功能验证 性能优化
相关文章