Vertueal Docs
Datalinc Platform

Virtual Databases

Provision, query, and manage fully isolated databases for your workspace.

Virtual Databases

A Virtual Database in Datalinc acts as an intelligent abstraction layer—a unified gateway that sits between your applications and your underlying physical databases (MySQL, MongoDB, PostgreSQL, etc.).

Instead of managing multiple connection strings and credentials in your application code, you create a single Virtual Database gateway. You can then configure Routing Rules to seamlessly route queries for specific entities (like users or orders) to the appropriate physical database backend.

Creating a Virtual Database

  1. Go to Data & Storage > Virtual Databases.
  2. Click Create Virtual Database.
  3. Name: Provide a logical name (e.g., Primary App Gateway).
  4. Default Physical Database: (Optional) Select a connected physical database to act as the fallback for any entities that don't match a specific routing rule.
  5. Entity Routing Rules: Define explicit routing rules for specific tables or collections.
    • Example: Route logs to your MongoDB database, and payments to your PostgreSQL database.
  6. Click Save Virtual Database.

Once created, you will be issued a unique API Key (e.g. dlc_vdb_...) for this virtual database.

Store Your Key Securely

For security reasons, your API Key is hashed in our systems and is only shown to you once upon creation. Please copy it immediately. If you lose it, you will need to provision a new Virtual Database.

External API Integration

You can perform CRUD operations on your Virtual Database from any external system using our unified REST API. The gateway will automatically translate and route your requests to the correct physical database based on your configured rules.

How Authentication Works (DX First)

Notice that you don't need to pass a databaseId in the URL or payload. Datalinc uses a Resource-Specific API Key model to provide a seamless Developer Experience (DX).

When you create a Virtual Database, the system generates a unique API Key. Because this key maps strictly to one gateway, our backend automatically identifies the targeted Virtual Database purely from your Bearer token.

This model guarantees Least Privilege Security:

  • Scoped Execution: The key is inherently bound to specific scopes (find, insert, update, delete).
  • Instant Revocation: If compromised, the Virtual Database can be toggled to an inactive status to immediately reject requests.
  • Isolation: A compromised key cannot access any other Virtual Database in your workspace.

Security Notice

Keep your API Key secure. Do not expose it in client-side code (like frontend React applications). Always make these requests from a secure backend server.

Find (Read) Example

Retrieve data from an entity.

const response = await fetch('https://datalincs.vertueal.com/api/v1/virtual-db', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    entity: 'users',
    action: 'find',
    query: {
      filters: { status: 'active' },
      sort: { field: 'createdAt', direction: 'desc' },
      limit: 10
    }
  })
});

const result = await response.json();
console.log(result.data);

Insert (Create) Example

Add a new record to an entity.

const response = await fetch('https://datalincs.vertueal.com/api/v1/virtual-db', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    entity: 'users',
    action: 'insert',
    data: {
      name: 'Example Record',
      status: 'active'
    }
  })
});

Update Example

Update an existing record using its id.

const response = await fetch('https://datalincs.vertueal.com/api/v1/virtual-db', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    entity: 'users',
    action: 'update',
    query: {
      filters: { id: 'RECORD_ID_HERE' }
    },
    data: {
      status: 'inactive'
    }
  })
});

Delete Example

Delete an existing record using its id.

const response = await fetch('https://datalincs.vertueal.com/api/v1/virtual-db', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    entity: 'users',
    action: 'delete',
    query: {
      filters: { id: 'RECORD_ID_HERE' }
    }
  })
});

On this page