Skip to content

docs(api): service boundaries RFC — decompose packages/api into 5 Cloudflare Workers #335

Description

@tomymaritano

Context

Founder decision: microservices on the backend, Cloudflare-native (independent Workers + service bindings; no Docker/k8s — Workers ARE the cheap micro-deployable). Today packages/api is one Hono app (auth, sync, subscription, newsletter, share, plugins, devices, admin) on Workers + Turso. Goal: isolated, independently deployable units a collaborator can own end-to-end. Recorded counsel: contract-versioning overhead is real for 2 people — mitigate contracts-first, split only along already-clean route boundaries.

Acceptance criteria

  • RFC: target services auth-service, sync-service, ai-gateway, plugin-registry, billing-webhooks; route ownership map from current packages/api/src/routes/*
  • Data ownership: which service owns which Turso tables; cross-service access ONLY via service bindings (no shared-table reach-ins), or split DBs where cheap
  • Topology decision with rationale: custom-domain path routing (api.dripnex.app/auth/* → auth-service) vs gateway worker
  • Migration order + cutover strategy (old monolith proxies during transition)
  • Local dev story: multi-service wrangler dev + service bindings locally

Depends on

Blocks the Q2 and Q3 service splits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0CriticalQ1Quarter 1wf:backend-servicesCloudflare Workers microservices

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions