> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cyborg.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Backing Stores

CyborgDB transforms traditional databases into Confidential Vector Databases by leveraging their storage capabilities while adding encrypted vector search functionality. Choose the backing store that best fits your existing infrastructure and operational requirements.

<img src="https://mintcdn.com/cyborg/kXyFWu9saA_TjOzS/images/cyborgdb-search-overview.png?fit=max&auto=format&n=kXyFWu9saA_TjOzS&q=85&s=2159d929922ba04a37b9864a2d401a6c" alt="CyborgDB RAG Overview" width="3185" height="2333" data-path="images/cyborgdb-search-overview.png" />

<Note>
  **Storage surface.** CyborgDB supports `disk` and `s3` (AWS S3 or any S3-compatible store) across both deployment models.
</Note>

## Amazon S3

*Available in: Service · Embedded*

**Scalable cloud object storage for distributed deployments**

CyborgDB supports Amazon S3 (and S3-compatible stores such as MinIO) as a backing store, enabling fully cloud-native deployments without managing a traditional database server.

### Key Benefits

**Infinite Scalability**\
Object storage scales seamlessly with your data — no capacity planning or provisioning required.

**Managed Infrastructure**\
No database servers to patch, tune, or back up. AWS handles availability and durability.

**S3-Compatible**\
Works with AWS S3, MinIO, Cloudflare R2, and any other S3-compatible object store that supports conditional writes.

**Best For:** Cloud-native deployments and workloads that already rely on object storage infrastructure.

***

## Disk

*Available in: Service · Embedded*

<Note>The embedded libraries and LangChain integration select this backend with `StorageConfig.disk(path)`. CyborgDB Service selects it via `CYBORGDB_DB_TYPE=disk` (and it is the default).</Note>

**Persistent local storage for single-node deployments**

The disk backend provides persistent key-value storage directly on local disk, with no network dependency. This makes it the recommended backing store for single-node CyborgDB deployments where simplicity and reliability are priorities.

### Key Benefits

**No Network Dependency**
All data is stored locally on disk — no external database servers to configure or manage.

**Persistent Storage**
Data survives process restarts.

**Optimized for Embedded Use**
Low memory footprint with filesystem support.

**Best For:** Embedded/local deployments, single-machine applications, edge devices, and scenarios where you want persistent storage without external infrastructure.

***

## Managed Services Support

CyborgDB works seamlessly with managed object storage services, reducing operational overhead while maintaining security and performance.

<CardGroup cols={3}>
  <Card title="AWS" icon="aws">
    **Amazon S3**\
    Scalable object storage with 11 nines of durability
  </Card>

  <Card title="Cloudflare" icon="cloudflare">
    **Cloudflare R2**\
    S3-compatible object storage with zero egress fees
  </Card>

  <Card title="Self-hosted" icon="server">
    **MinIO**\
    S3-compatible object storage you control end-to-end
  </Card>
</CardGroup>

***

## Choosing the Right Backing Store

<Tabs>
  <Tab title="Use Disk">
    * **Single-node deployment** — You want persistent local storage with no external dependencies
    * **Edge devices** — Running on hardware without network access to databases
    * **Simplicity** — You want a single-binary deployment with built-in storage
    * **Local development** — Persistent storage that survives restarts without infrastructure
    * **Default choice** — It's the service default and works out of the box
  </Tab>

  <Tab title="Use S3">
    * **Cloud-Native** — Your infrastructure already uses AWS or S3-compatible storage
    * **Serverless** — You want durable storage without managing database servers
    * **Cost** — Object storage is cheaper than provisioned database instances at scale
    * **MinIO / R2** — You want S3-compatible storage on-premise or in a private cloud
  </Tab>
</Tabs>

<Warning>
  **One process per storage target.** A given disk path or S3 bucket/prefix must be used by a single CyborgDB process (embedded application or service instance) at a time. Running multiple processes or service replicas against the same storage target is not currently supported. To scale, add CPU threads or GPU acceleration to a single process, or shard indexes across separate storage targets.
</Warning>

## Configuration Examples

### Embedded library

```python Disk theme={null}
from cyborgdb_core import Client, StorageConfig

# Local disk
storage_config = StorageConfig.disk("/var/lib/cyborgdb")

client = Client(storage_config=storage_config)
```

```python S3 theme={null}
from cyborgdb_core import StorageConfig, S3Credentials

# AWS S3 (credentials from the AWS default credential chain)
storage_config = StorageConfig.s3("my-bucket", region="us-east-1")

# AWS S3 with explicit credentials
storage_config = StorageConfig.s3(
    "my-bucket",
    region="us-east-1",
    credentials=S3Credentials(access_key="AKID...", secret_key="..."),
)

# MinIO (S3-compatible)
storage_config = StorageConfig.s3(
    "my-bucket",
    region="us-east-1",
    endpoint="http://localhost:9000",
    credentials=S3Credentials(access_key="minioadmin", secret_key="minioadmin"),
)
```

### Service

Select via the `CYBORGDB_DB_TYPE` environment variable (or the equivalent YAML key). See [Environment Variables](../service/guides/advanced/env-vars) for the full list.

```bash theme={null}
# disk (default)
export CYBORGDB_DB_TYPE=disk
export CYBORGDB_DISK_PATH=/var/lib/cyborgdb   # optional, defaults to ~/.cyborgdb/data
export CACHE_POLICY_VECTORS=true              # optional, disk only
export CACHE_POLICY_METADATA=true             # optional, disk only
export CACHE_POLICY_IDS=true                  # optional, disk only

# s3
export CYBORGDB_DB_TYPE=s3
export CYBORGDB_S3_BUCKET=my-bucket
export CYBORGDB_S3_REGION=us-east-1
export CYBORGDB_S3_ENDPOINT=http://localhost:9000   # optional, for S3-compatible stores
export CYBORGDB_S3_PREFIX=cyborgdb/                 # optional
export CYBORGDB_S3_ACCESS_KEY=...                   # optional, otherwise the AWS default credential chain
export CYBORGDB_S3_SECRET_KEY=...
export CYBORGDB_S3_SESSION_TOKEN=...                # optional
```

<Note>With a custom `CYBORGDB_S3_ENDPOINT` (MinIO, R2, etc.), set `CYBORGDB_S3_ACCESS_KEY` and `CYBORGDB_S3_SECRET_KEY` explicitly.</Note>

## Performance Characteristics

| Backing Store | Latency | Throughput | Durability | Consistency |
| - | :-: | :-: | :-: | :-: |
| **Disk** | \~10µs | High | Local Disk | Single Process |
| **S3** | \~10ms | Medium | Full (11 nines) | Strong |

Choose based on your application's specific requirements for speed, durability, and consistency.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.