Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_file-storage-sync

Google Drive-style file storage (block sync with presigned uploads)

14 COMPONENTS · 16 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[![Google Drive-style file storage (block sync with presigned uploads) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_file-storage-sync/opengraph-image)](https://archos.sageideas.dev/d/dgm_file-storage-sync)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_file-storage-sync)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_file-storage-sync" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Google Drive-style file storage (block sync with presigned uploads) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0[("Sync client")]
  deviceb_1[("Second device")]
  secrets_2[("Secrets manager")]
  gw_3["API gateway"]
  metrics_4[("Time-series database (TSDB)")]
  alerting_5[("Alerting")]
  policy_6["Policy decision point (PDP)"]
  meta_7["Metadata service"]
  obj_8[("Object storage")]
  dlq_9[("Dead-letter queue (DLQ)")]
  metadb_10[("Metadata store")]
  cdc_11[("Change Data Capture (CDC)")]
  queue_12[("Message queue")]
  capacity_13["Capacity Estimate"]
  client_0 -->|"1. Calls with JWT · HTTPS"| gw_3
  gw_3 -->|"2. Forwards (mTLS) · HTTP/2"| meta_7
  meta_7 -->|"3. Returns URLs · HTTP/2"| gw_3
  gw_3 -->|"4. Relays URLs · HTTPS"| client_0
  client_0 -->|"5. Uploads with URL · HTTPS"| obj_8
  obj_8 -->|"6. Notifies upload done · HTTPS"| meta_7
  meta_7 -->|"7. Commits version · HTTPS"| metadb_10
  metadb_10 -->|"8. Streams changes · HTTPS"| cdc_11
  cdc_11 -->|"9. Publishes reference · TCP"| queue_12
  queue_12 -->|"10a. Delivers change notice · HTTPS"| deviceb_1
  queue_12 -->|"10b. Parks poison messages · TCP"| dlq_9
  meta_7 -->|"Asks permission (mTLS) · gRPC"| policy_6
  secrets_2 -->|"Supplies signing key · HTTPS"| meta_7
  metrics_4 -->|"Scrapes queue lag · HTTPS"| queue_12
  metrics_4 -->|"Feeds alerts · HTTPS"| alerting_5
  metrics_4 -->|"Scrapes DLQ depth · HTTPS"| dlq_9

COMPONENT STACK (13)

  • Sync clientSTATEFUL
    Watches a folder and uploads changed blocks
  • Second deviceSTATEFUL
    Gets the change notice, then pulls the change
  • Secrets managerSTATEFUL
    Holds the key that signs upload URLs
  • API gatewaySTATELESS
    Checks the JWT, then forwards to metadata
  • Time-series database (TSDB)STATEFUL
    Stores queue lag and DLQ depth
  • AlertingSTATEFUL
    Pages on-call on lag or dead letters
  • Policy decision point (PDP)STATELESS
    Decides if this user may write this folder
  • Metadata serviceSTATELESS
    Compares hash trees, signs URLs, commits
  • Object storageSTATEFUL
    Holds blocks keyed by user and hash
  • Dead-letter queue (DLQ)STATEFUL
    Parks messages that keep failing
  • Metadata storeSTATEFUL
    Versions, folder hash tree, outbox rows
  • Change Data Capture (CDC)STATEFUL
    Reads outbox rows from the change stream
  • Message queueSTATEFUL
    One queue per device

REQUEST & DATA FLOW (16)

  1. Sync client → API gateway (Calls with JWT)[HTTPS]
  2. API gateway → Metadata service (Forwards (mTLS))[HTTP/2]
  3. Metadata service → API gateway (Returns URLs)[HTTP/2]
  4. API gateway → Sync client (Relays URLs)[HTTPS]
  5. Sync client → Object storage (Uploads with URL)[HTTPS]
  6. Object storage → Metadata service (Notifies upload done)[HTTPS]
  7. Metadata service → Metadata store (Commits version)[HTTPS]
  8. Metadata store → Change Data Capture (CDC) (Streams changes)[HTTPS]
  9. Change Data Capture (CDC) → Message queue (Publishes reference)[TCP]
  10. Message queue → Second device (Delivers change notice)[HTTPS]
  11. Message queue → Dead-letter queue (DLQ) (Parks poison messages)[TCP]
  12. Metadata service → Policy decision point (PDP) (Asks permission (mTLS))[gRPC]
  13. Secrets manager → Metadata service (Supplies signing key)[HTTPS]
  14. Time-series database (TSDB) → Message queue (Scrapes queue lag)[HTTPS]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →