← 返回刚才阅读的位置

知识卡片

问题卡 · 2499.b.1

存储查询区分执行与管理

理解等级:中级

复杂查询过长或重复执行成本高时,可先保存查询定义,再通过稳定资源入口重用。

将长查询放在请求体里创建查询资源,再以URL重新执行并取得结果,避免每次传超长URL,也便于缓存读取结果。查询定义、当次结果与管理入口要区分。

列表、筛选、修改、删除、分享管理查询集合;owner、tags、最后执行时间等帮助管理。重放既可能取既存结果,也可能按保存条件重新计算,接口必须讲明并返回缓存契约。共享查询还需决定编辑权限,必要时让使用者复制后修改。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体工作流 · 查看原书依据

      The first step to making complex queries safe and easy to use is to implement the query itself as a resource. That means expressing the query details as an HTTP body and then using that message body to create a new query resource that can then be executed directly upon request.

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第7章《超媒体工作流》§7.14(来源项目:book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch07.xhtml) - 结论依据:原文以将长查询放在请求体里创建查询资源,再以URL重新执行并取得结果,避免每次传超长URL,也便于缓存读取结果的方式说明该用途;同节示例与讨论补充了卡内条件和边界。 - 原始内容:The first step to making complex queries safe and easy to use is to implement the query itself as a resource. That means expressing the query details as an HTTP body and then using that message body to create a new query resource that can then be executed directly upon request.