← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 2931.e.2.b.3.a

共享查询必须限定租户

理解等级:中级

共享表用租户标识关联数据,查询时先限定当前租户,再按状态等业务条件筛选。不同套餐若使用独立表或共享表,还需把租户语境映射到正确存储。查询正确性是必要条件,但不能替代阻止代码越界的隔离策略。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Building Multi-Tenant Services · 查看原书依据

      the same table. When the data is pooled, we can simply add a TenantId key to our order table that will associate each order with a specific tenant. This tenant identifier will become the key of our table. This means that the status we were using will now become a secondary search parameter that returns all orders for a tenant

    参考来源

    - 位置:《Building Multi-Tenant SaaS Architectures》第07章《Building Multi-Tenant Services》(来源项目 a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Multi-Tenant SaaS Architectures/_epub-src/OEBPS/ch07.html) - 结论依据:原文具体说明共享表用租户标识关联数据,查询时先限定当前租户,再按状态等业务条件筛选;本卡据此归纳机制及适用边界。 - 原始内容:the same table. When the data is pooled, we can simply add a TenantId key to our order table that will associate each order with a specific tenant. This tenant identifier will become the key of our table. This means that the status we were using will now become a secondary search parameter that returns all orders for a tenant