Database Clusters

Database clusters are the core of CredVault. A cluster is the user's isolated database workspace: collections, documents, API access, rules, functions, backups, scaling, maintenance, and monitoring all attach to a cluster.

Where Users Manage Clusters

TaskDashboard pathBackend route
List clusters/clusterGET /api/clusters
Create cluster/clusterPOST /api/clusters
View cluster/cluster/{clusterId}GET /api/clusters/{clusterId}
Delete cluster/cluster/{clusterId}DELETE /api/clusters/{clusterId}
View connection detailsCluster settingsGET /api/clusters/{clusterId}/connection
Rotate credentialsCluster settingsPOST /api/clusters/{clusterId}/rotate-credentials
Pause/unpause clusterCluster settingsPOST /api/clusters/{clusterId}/pause, POST /api/clusters/{clusterId}/unpause
Scaling/scaling/{clusterId}POST /api/clusters/{clusterId}/scale
Backups/backups/{clusterId}Backup routes and cluster backup settings
Maintenance/maintenance/{clusterId}Maintenance settings and maintenance execution routes

How A Cluster Works

When a user creates a cluster:

  1. CredVault validates the user's tenant and billing state.
  2. The backend stores cluster metadata.
  3. The platform creates database access details.
  4. The dashboard shows the cluster in /cluster.
  5. Collections and documents can be managed through /cluster/{clusterId}.
  6. API keys can be scoped to the cluster for application access.

Collections And Documents

Collections and documents are managed through the data routes:

TaskBackend route
List collectionsGET /api/data/clusters/{clusterId}/collections
Create collectionPOST /api/data/clusters/{clusterId}/collections
Delete collectionDELETE /api/data/clusters/{clusterId}/collections/{collectionName}
List documentsGET /api/data/clusters/{clusterId}/collections/{collectionName}/documents
Insert documentPOST /api/data/clusters/{clusterId}/collections/{collectionName}/documents
Update documentPUT /api/data/clusters/{clusterId}/collections/{collectionName}/documents/{documentId}
Delete documentDELETE /api/data/clusters/{clusterId}/collections/{collectionName}/documents/{documentId}

Test It In The API Explorer

Open /api-docs, authorize, then run:

Example
GET /api/clusters
GET /api/data/clusters/{clusterId}/collections
GET /api/data/clusters/{clusterId}/collections/{collectionName}/documents

What you should see: the explorer should show an HTTP status, request URL, response headers, and a JSON response. A successful cluster request returns the clusters your account can access. If you are not logged in or your token is wrong, you should see an authentication error.

You can also test with curl:

Terminal
Test in API explorer
curl https://credvault-production.up.railway.app/api/clusters \
  -H "Authorization: Bearer <your-session-token>"
What you should seeA JSON response, an HTTP status, or a clear authentication or permission error.

What you should see: a JSON list of clusters, or an empty list if your account has not created one yet.

Create a collection:

Terminal
Test in API explorer
curl -X POST https://credvault-production.up.railway.app/api/data/clusters/<clusterId>/collections \
  -H "Authorization: Bearer <your-session-token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"customers"}'
What you should seeA JSON response, an HTTP status, or a clear authentication or permission error.

What you should see: a success response confirming that the customers collection exists. If the collection already exists, the API should return a clear conflict or validation message.

Insert a document:

Terminal
Test in API explorer
curl -X POST https://credvault-production.up.railway.app/api/data/clusters/<clusterId>/collections/customers/documents \
  -H "Authorization: Bearer <your-session-token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ada","plan":"team","active":true}'
What you should seeA JSON response, an HTTP status, or a clear authentication or permission error.

What you should see: a JSON response with the inserted document or document ID. After that, the same record should appear in the dashboard collection view.

SQL Through LakeVault

CIE exposes a SQL route for authenticated users:

Terminal
cie sql "SELECT name, plan FROM customers WHERE active = true LIMIT 20"

Behind the scenes, the backend receives:

Example
POST /api/cie/sql

The SQL engine translates supported SQL into database operations. Read queries return rows. Write queries are audited.

Security Around Clusters

Cluster APIs are protected by:

  • User authentication
  • Tenant access checks
  • Cluster access checks
  • IP allowlist enforcement on sensitive paths
  • Activity logging for create, update, delete, pause, unpause, scale, credential rotation, and maintenance actions
  • Credit and account-lock middleware before API usage

Performance Features

CredVault exposes the building blocks users expect in a managed database platform:

  • Collection-level document operations
  • Query pagination
  • Cluster stats
  • Scaling routes
  • Maintenance windows
  • Backup settings
  • Credential rotation
  • Activity tracking

What To Document In Runbooks

For production users, document:

  • Cluster naming convention
  • Which API keys can access the cluster
  • Backup schedule
  • Maintenance window
  • Scaling policy
  • IP allowlist
  • Rotation schedule for credentials
  • Owner responsible for cost and usage