On this page

Data and Tenancy#

Where data lives#

Store What it holds
PostgreSQL on Neon Almost everything: organizations, users, work items, boards, roadmaps, comments, time entries, Service Desk tickets, Knowledge Base articles, settings and billing records. The pgvector extension holds the text embeddings behind AI search.
Amazon DynamoDB A few small, fast stores: AI chat history, rate-limit counters, short-lived processing records, the time-tracking store, and the record of which migrations have run.
Amazon S3 Files: attachments and images, import and export files, analytics exports, raw inbound email, portal uploads, the built documentation sites and the web app itself.

The application connects to PostgreSQL with TLS required. The data layer uses the Drizzle ORM with the pg driver. There is no separate search engine or cache cluster to run.

How organizations are kept apart#

DevStride is multi-tenant. All organizations share one database, and every tenant table carries the id of the organization that owns the row. Organizations are kept apart at several layers:

  1. At the front door. Every request is checked by an authorizer before it reaches the application. The authorizer lets it through only to the organizations the caller is an active member of and is allowed to sign in to under that organization's sign-in rules.
  2. In every request. The organization comes from the request path, and every read and write is scoped to it. API keys and OAuth tokens are each bound to a single organization.
  3. Inside the organization. Roles and per-object sharing decide what each person can see and change. See Security and Identity.
  4. In real-time updates. Updates are pushed on private channels for each organization and each user, and the backend authorizes every subscription.

Direct database access for reporting. An organization can issue read-only database credentials for its own BI tools. Those credentials are a separate database role with row-level security policies that limit every query to that organization's rows.

Rollups#

Totals for each part of a hierarchy, such as counts, estimates, effort, time spent and date ranges, are stored on the parent rows. Database functions keep them up to date, run in the background from ordered events. A full recalculation can be run for an organization at any time.

Changing the database safely#

Database changes ship as numbered SQL migrations, generated from the schema definitions and kept in the repository. Old and new versions of the application run side by side for a short time during every deploy, so migrations follow a strict set of rules:

  • Repeatable. A migration can run twice without harm.
  • Additive first. New columns and tables are added, data is backfilled, and only then are constraints tightened.
  • Destructive steps last. A step that drops or renames something is staged across releases and ships separately, once nothing still uses the old shape.
  • Messages in flight still work. Background messages already queued keep working when their format changes, because each consumer reads both the old and new format.
  • A checkpoint first for large changes. A migration marked as needing a checkpoint will not start in production until a recent, verified point-in-time copy of the database exists. The deploy stops before touching production if there isn't one.
  • Approved before release. A person approves every new migration before the release that carries it.

Backup and recovery#

  • PostgreSQL. Neon keeps a continuous history of the database, so it can be restored to any point within its retention window. Before large changes, a named checkpoint branch of the database is also taken and kept for 14 days.
  • DynamoDB. Point-in-time recovery is switched on for every table, and the production and staging tables are protected from deletion.
  • S3. File buckets keep earlier versions of changed or deleted files for 30 to 90 days, depending on the bucket. Long-lived environments keep their buckets if a stack is ever removed.
  • Events. Events that could not be processed are kept for 14 days in dead-letter queues, where they can be inspected and re-sent. The event bus also keeps an archive.

Retention#

  • Application logs are kept for one year.
  • Activity history and automation run records are kept for one year.
  • Sign-in records are kept for 90 days.
Powered by DevStride