← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 2313.e.5.f.10.b.1.b.3.c

纵向拆分隔离访问模式

理解等级:中级

把商品核心属性和评论等不同访问模式的数据分开,可分别扩容、索引和维护;原书用独立评论表说明这种责任拆分。代价是组合查询及跨存储一致性,需在读取成本与独立演进间选择。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Data Storage Strategies · 查看原书依据

      While horizontal partitioning helps manage data volume, we can implement vertical partitioning to separate different aspects of our product data. For instance, we can separate product reviews into their own database, as follows: -- Core product information remains in the main product table CREATE TABLE products ( product_id UUID PRIMARY KEY, name VARCHAR(255), base_price DECIMAL, category_id UUID, -- Other essential fields ); -- Reviews live in a separate database CREATE TABLE product_reviews ( review_id UUID PRIMARY KEY, product_id UUID, customer_id UUID, rating INTEGER, review_text TEXT, review_date TIMESTAMP, helpful_votes INTEGER, -- Additional review metadata ); This separation serves multiple purposes.

    参考来源

    - 位置:《Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…》第09章《Data Storage Strategies》(来源项目book-sources;源文件:extracted/Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…/_epub-src/OPS/ch09.xhtml) - 结论依据:原文给出本卡对应定义或示例;把商品核心属性和评论等不同访问模式的数据分开,可分别扩容、索引和维护;原书用独立评论表说明这种责任拆分。 对原文省略和过度承诺的限定是本卡显式纠正,不能反过来当作原书已证明。 - 原始内容:While horizontal partitioning helps manage data volume, we can implement vertical partitioning to separate different aspects of our product data. For instance, we can separate product reviews into their own database, as follows: -- Core product information remains in the main product table CREATE TABLE products ( product_id UUID PRIMARY KEY, name VARCHAR(255), base_price DECIMAL, category_id UUID, -- Other essential fields ); -- Reviews live in a separate database CREATE TABLE product_reviews ( review_id UUID PRIMARY KEY, product_id UUID, customer_id UUID, rating INTEGER, review_text TEXT, review_date TIMESTAMP, helpful_votes INTEGER, -- Additional review metadata ); This separation serves multiple purposes.