diff --git a/src/components/StorageDecisionTree.astro b/src/components/StorageDecisionTree.astro new file mode 100644 index 00000000000..f85c9df95d0 --- /dev/null +++ b/src/components/StorageDecisionTree.astro @@ -0,0 +1,343 @@ +
+
+ Start with the first question. If neither answer describes your application, + continue to the next numbered question. +
+ +
    +
  1. +
    + 1 +

    Is your data already in Postgres or MySQL?

    +
    +
    +
    + Yes +

    + Keep it as the source of truth and start with Hyperdrive. +

    +
    +
    + No +

    Continue to question 2.

    +
    +
    +
  2. + +
  3. +
    + 2 +

    Are you storing files, blobs, media, logs, or datasets?

    +
    +
    +
    + Yes + +
    +

    + Yes: Use Pipelines, + usually writing to R2. +

    +

    No: Use R2.

    +
    +
    +
    + No +

    Continue to question 3.

    +
    +
    +
  4. + +
  5. +
    + 3 +

    Are you storing events, metrics, or telemetry for analysis?

    +
    +
    +
    + Yes + +
    +

    + Yes: Use Workers Analytics Engine. +

    +

    + No: Use Pipelines to store + raw events. +

    +
    +
    +
    + No +

    Continue to question 4.

    +
    +
    +
  6. + +
  7. +
    + 4 +

    + Are you storing embeddings for semantic search, recommendations, or + retrieval-augmented generation? +

    +
    +
    +
    + Yes +

    Start with Vectorize.

    +
    +
    + No +

    Continue to question 5.

    +
    +
    +
  8. + +
  9. +
    + 5 +

    + Do you need background work, buffering, retries, or service-to-service + messaging? +

    +
    +
    +
    + Yes +

    Start with Queues.

    +
    +
    + No +

    Continue to question 6.

    +
    +
    +
  10. + +
  11. +
    + 6 +

    + Is your data read by key, written infrequently, and suitable for + eventual consistency? +

    +
    +
    +
    + Yes +

    Start with Workers KV.

    +
    +
    + No +

    Continue to question 7.

    +
    +
    +
  12. + +
  13. +
    + 7 +

    Do you need SQL, joins, or ad hoc queries over structured data?

    +
    +
    +
    + Yes + +
    +

    Yes: Use D1.

    +

    + No: Use Durable Objects when one owner needs serialized writes, WebSockets, alarms, or in-memory + state. Otherwise, use D1. +

    +
    +
    +
    + No + +
    +

    + Yes: Use Durable Objects. +

    +

    + No: Review the product overviews or combine products. +

    +
    +
    +
    +

    + Combine Durable Objects with D1 when you need coordination and + application-wide SQL queries or reporting. +

    +
  14. +
+
+ + diff --git a/src/content/docs/workers/platform/storage-options.mdx b/src/content/docs/workers/platform/storage-options.mdx index 0452b712ab5..8e7fdae23bb 100644 --- a/src/content/docs/workers/platform/storage-options.mdx +++ b/src/content/docs/workers/platform/storage-options.mdx @@ -12,6 +12,7 @@ products: --- import { Render, Details } from "~/components"; +import StorageDecisionTree from "~/components/StorageDecisionTree.astro"; This guide describes the storage & database products available as part of Cloudflare Workers, including recommended use-cases and best practices. @@ -23,6 +24,12 @@ The following table maps our storage & database products to common industry term Applications can build on multiple storage & database products: for example, using Workers KV for session data; R2 for large file storage, media assets and user-uploaded files; and Hyperdrive to connect to a hosted Postgres or MySQL database. +## Decision tree + +Start with the shape of your data and the guarantees your application needs. Some applications use more than one product. + + + :::note[Pages Functions] Storage options can also be used by your front-end application built with Cloudflare Pages. For more information on available storage options for Pages applications, refer to the [Pages Functions bindings documentation](/pages/functions/bindings/).