# get-convex/convex-backend architecture

> Architecture diagram of the GitHub repository get-convex/convex-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/get-convex/convex-backend
- Repository: https://github.com/get-convex/convex-backend

## Overview

Convex is a reactive database platform for web applications: clients invoke server functions and subscribe to live query results, while the backend executes functions against consistent database state. The repository also includes file storage, snapshot import/export, search and vector indexing, and external data connectors. The map follows the client-to-function-to-database product shape and retains these documented capability branches. Several backend entry-point relationships are architectural rather than visible in the sampled excerpts, so those links are marked unverified.

Main entry points: [`npm-packages/convex/src/browser/sync/client.ts`](https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/client.ts) (Convex client), [`crates/local_backend/src/router.rs`](https://github.com/get-convex/convex-backend/blob/main/crates/local_backend/src/router.rs) (Backend serving edge), [`crates/database/src/transaction.rs`](https://github.com/get-convex/convex-backend/blob/main/crates/database/src/transaction.rs) (Reactive database), [`crates/function_runner/src/server.rs`](https://github.com/get-convex/convex-backend/blob/main/crates/function_runner/src/server.rs) (Function runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client libraries"]
  node_client_sdk["Convex client<br/>[client.ts]"]
  node_client_transport["WebSocket transport"]
  node_auth["Client authentication"]
  node_protocol["Sync protocol<br/>[protocol.ts]"]
  node_pagination["Paginated subscriptions"]
  node_values["Value and validators<br/>[validators.ts]"]
end

subgraph group_runtime["Function runtime"]
  node_backend["Backend serving edge<br/>[router.rs]"]
  node_function_runner["Function runner<br/>[server.rs]"]
  node_isolate["JavaScript execution<br/>[mod.rs]"]
  node_request_scope["Request context<br/>[request_scope.rs]"]
end

subgraph group_data["Database and indexes"]
  node_database[("Reactive database<br/>[transaction.rs]")]
  node_search["Text search<br/>[query.rs]"]
  node_text_index["Text index manager"]
  node_vector_index["Vector indexing"]
end

subgraph group_storage["Storage and transfer"]
  node_file_storage[("File storage<br/>[core.rs]")]
  node_storage_ops["Storage syscalls<br/>[storage.rs]"]
  node_snapshot_import["Snapshot import<br/>[mod.rs]"]
  node_import_parser["Import parsing<br/>[parse.rs]"]
  node_snapshot_export["Snapshot export<br/>[export_storage.rs]"]
end

subgraph group_integrations["Integrations"]
  node_s3["S3 object storage<br/>[storage.rs]"]
  node_fivetran["Fivetran connectors<br/>[application.rs]"]
end

node_developer(("Web app developer"))

node_developer -->|"uses client"| node_client_sdk
node_client_sdk -->|"manages connection"| node_client_transport
node_client_sdk -->|"uses auth"| node_auth
node_client_sdk -->|"uses protocol"| node_protocol
node_client_sdk -->|"uses values"| node_values
node_client_sdk -.->|"sends function requests"| node_backend
node_client_sdk -->|"creates paginated queries"| node_pagination
node_backend -.->|"dispatches functions"| node_function_runner
node_function_runner -.->|"executes functions"| node_isolate
node_isolate -->|"uses request context"| node_request_scope
node_isolate -->|"performs storage operations"| node_file_storage
node_function_runner -.->|"runs database functions"| node_database
node_backend -.->|"supports snapshot import"| node_snapshot_import
node_snapshot_import -->|"parses import file"| node_import_parser
node_snapshot_import -->|"imports records"| node_database
node_backend -.->|"supports snapshot export"| node_snapshot_export
node_snapshot_export -->|"reads stored files"| node_file_storage
node_snapshot_export -.->|"uploads archive"| node_s3
node_text_index -->|"uses query engine"| node_search
node_search -.->|"queries indexed data"| node_database
node_database -.->|"supports vector indexes"| node_vector_index
node_file_storage -.->|"stores objects"| node_s3
node_fivetran -.->|"connects data"| node_backend

click node_client_sdk "https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/client.ts"
click node_client_transport "https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/web_socket_manager.ts"
click node_auth "https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/authentication_manager.ts"
click node_protocol "https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/protocol.ts"
click node_pagination "https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/paginated_query_client.ts"
click node_values "https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/values/validators.ts"
click node_backend "https://github.com/get-convex/convex-backend/blob/main/crates/local_backend/src/router.rs"
click node_function_runner "https://github.com/get-convex/convex-backend/blob/main/crates/function_runner/src/server.rs"
click node_isolate "https://github.com/get-convex/convex-backend/blob/main/crates/isolate/src/environment/mod.rs"
click node_request_scope "https://github.com/get-convex/convex-backend/blob/main/crates/isolate/src/request_scope.rs"
click node_database "https://github.com/get-convex/convex-backend/blob/main/crates/database/src/transaction.rs"
click node_search "https://github.com/get-convex/convex-backend/blob/main/crates/search/src/query.rs"
click node_text_index "https://github.com/get-convex/convex-backend/blob/main/crates/search/src/text_index_manager.rs"
click node_vector_index "https://github.com/get-convex/convex-backend/blob/main/crates/vector/src/vector_index_manager.rs"
click node_file_storage "https://github.com/get-convex/convex-backend/blob/main/crates/file_storage/src/core.rs"
click node_storage_ops "https://github.com/get-convex/convex-backend/blob/main/crates/isolate/src/environment/action/storage.rs"
click node_snapshot_import "https://github.com/get-convex/convex-backend/blob/main/crates/application/src/snapshot_import/mod.rs"
click node_import_parser "https://github.com/get-convex/convex-backend/blob/main/crates/application/src/snapshot_import/parse.rs"
click node_snapshot_export "https://github.com/get-convex/convex-backend/blob/main/crates/exports/src/export_storage.rs"
click node_s3 "https://github.com/get-convex/convex-backend/blob/main/crates/aws_s3/src/storage.rs"
click node_fivetran "https://github.com/get-convex/convex-backend/blob/main/crates/fivetran_destination/src/application.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_sdk,node_client_transport,node_auth,node_protocol,node_pagination,node_values toneBlue
class node_backend,node_function_runner,node_isolate,node_request_scope toneAmber
class node_database,node_search,node_text_index,node_vector_index toneMint
class node_file_storage,node_storage_ops,node_snapshot_import,node_import_parser,node_snapshot_export toneRose
class node_s3,node_fivetran,node_developer toneIndigo
```

## Components

### Client libraries

- [Convex client](https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/client.ts): `npm-packages/convex/src/browser/sync/client.ts`
- [WebSocket transport](https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/web_socket_manager.ts): `npm-packages/convex/src/browser/sync/web_socket_manager.ts`
- [Client authentication](https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/authentication_manager.ts): `npm-packages/convex/src/browser/sync/authentication_manager.ts`
- [Sync protocol](https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/protocol.ts): `npm-packages/convex/src/browser/sync/protocol.ts`
- [Paginated subscriptions](https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/browser/sync/paginated_query_client.ts): `npm-packages/convex/src/browser/sync/paginated_query_client.ts`
- [Value and validators](https://github.com/get-convex/convex-backend/blob/main/npm-packages/convex/src/values/validators.ts): `npm-packages/convex/src/values/validators.ts`

### Function runtime

- [Backend serving edge](https://github.com/get-convex/convex-backend/blob/main/crates/local_backend/src/router.rs): `crates/local_backend/src/router.rs`
- [Function runner](https://github.com/get-convex/convex-backend/blob/main/crates/function_runner/src/server.rs): `crates/function_runner/src/server.rs`
- [JavaScript execution](https://github.com/get-convex/convex-backend/blob/main/crates/isolate/src/environment/mod.rs): `crates/isolate/src/environment/mod.rs`
- [Request context](https://github.com/get-convex/convex-backend/blob/main/crates/isolate/src/request_scope.rs): `crates/isolate/src/request_scope.rs`

### Database and indexes

- [Reactive database](https://github.com/get-convex/convex-backend/blob/main/crates/database/src/transaction.rs): `crates/database/src/transaction.rs`
- [Text search](https://github.com/get-convex/convex-backend/blob/main/crates/search/src/query.rs): `crates/search/src/query.rs`
- [Text index manager](https://github.com/get-convex/convex-backend/blob/main/crates/search/src/text_index_manager.rs): `crates/search/src/text_index_manager.rs`
- [Vector indexing](https://github.com/get-convex/convex-backend/blob/main/crates/vector/src/vector_index_manager.rs): `crates/vector/src/vector_index_manager.rs`

### Storage and transfer

- [File storage](https://github.com/get-convex/convex-backend/blob/main/crates/file_storage/src/core.rs): `crates/file_storage/src/core.rs`
- [Storage syscalls](https://github.com/get-convex/convex-backend/blob/main/crates/isolate/src/environment/action/storage.rs): `crates/isolate/src/environment/action/storage.rs`
- [Snapshot import](https://github.com/get-convex/convex-backend/blob/main/crates/application/src/snapshot_import/mod.rs): `crates/application/src/snapshot_import/mod.rs`
- [Import parsing](https://github.com/get-convex/convex-backend/blob/main/crates/application/src/snapshot_import/parse.rs): `crates/application/src/snapshot_import/parse.rs`
- [Snapshot export](https://github.com/get-convex/convex-backend/blob/main/crates/exports/src/export_storage.rs): `crates/exports/src/export_storage.rs`

### Integrations

- [S3 object storage](https://github.com/get-convex/convex-backend/blob/main/crates/aws_s3/src/storage.rs): `crates/aws_s3/src/storage.rs`
- [Fivetran connectors](https://github.com/get-convex/convex-backend/blob/main/crates/fivetran_destination/src/application.rs): `crates/fivetran_destination/src/application.rs`

### Other components

- **Web app developer**

## Connections

- Web app developer → Convex client: uses client (evidence: `README.md`)
- Convex client → WebSocket transport: manages connection (evidence: `npm-packages/convex/src/browser/sync/client.ts`)
- Convex client → Client authentication: uses auth (evidence: `npm-packages/convex/src/browser/sync/client.ts`)
- Convex client → Sync protocol: uses protocol (evidence: `npm-packages/convex/src/browser/sync/client.ts`)
- Convex client → Value and validators: uses values (evidence: `npm-packages/convex/src/browser/sync/client.ts`)
- Convex client → Backend serving edge: sends function requests
- Convex client → Paginated subscriptions: creates paginated queries (evidence: `npm-packages/convex/src/browser/sync/paginated_query_client.ts`)
- Backend serving edge → Function runner: dispatches functions
- Function runner → JavaScript execution: executes functions
- JavaScript execution → Request context: uses request context (evidence: `crates/isolate/src/ops/storage.rs`)
- JavaScript execution → File storage: performs storage operations
- Function runner → Reactive database: runs database functions
- Backend serving edge → Snapshot import: supports snapshot import
- Snapshot import → Import parsing: parses import file (evidence: `crates/application/src/snapshot_import/mod.rs`)
- Snapshot import → Reactive database: imports records (evidence: `crates/application/src/snapshot_import/mod.rs`)
- Backend serving edge → Snapshot export: supports snapshot export
- Snapshot export → File storage: reads stored files (evidence: `crates/exports/src/export_storage.rs`)
- Snapshot export → S3 object storage: uploads archive
- Text index manager → Text search: uses query engine (evidence: `crates/search/src/text_index_manager.rs`)
- Text search → Reactive database: queries indexed data
- Reactive database → Vector indexing: supports vector indexes
- File storage → S3 object storage: stores objects
- Fivetran connectors → Backend serving edge: connects data
