← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 2274.h.7.d

分片查询可能慢于单机

理解等级:高级

按用户或商品ID把数据分片后,无状态服务可路由到对应存储。但跨分片购买或查询仍要协调多个分片,可能使多节点方案比单节点更慢。分片键应尽量让常见查询无需跨区联接,运维和数据恢复也需要经验;不能只因数据库是瓶颈就立刻认为分片必然改善。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 高可用与扩展 · 查看原书依据

      Also due to stateless services, scaling often comes down to sharding (partitioning the database) across multiple nodes or using a NoSQL-style database. Both require us to find a dimension (column) in the data that we can use to separate data into partitions, such that we do not have to issue a join via SQL for the data in different partitions to answer the queries. Several databases support sharding, but setting up and running a sharded database is complex and requires skilled professionals. Even with such skills, with some queries that need data from multiple shards, a sharded multiple-node database is slower than a single-node database.

    参考来源

    - 位置:《Software Architecture and Decision-Making》第09章《高可用与扩展》(来源项目:book-sources;源文件:extracted/Software Architecture and Decision-Making Leveraging Leadership, Technology, and Product Management to Build Great Products… (Srinath Perera)/_epub-src/ch09.xhtml) - 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。 - 原始内容:Also due to stateless services, scaling often comes down to sharding (partitioning the database) across multiple nodes or using a NoSQL-style database. Both require us to find a dimension (column) in the data that we can use to separate data into partitions, such that we do not have to issue a join via SQL for the data in different partitions to answer the queries. Several databases support sharding, but setting up and running a sharded database is complex and requires skilled professionals. Even with such skills, with some queries that need data from multiple shards, a sharded multiple-node database is slower than a single-node database.