Pick storage for the workload, keep one API for the data.
1. What a Backend Is
A backend is a physical storage provider registered inside a workspace. HeavenBase routes fields to backend instances by name, then uses handlers to compile supported query operations for each provider. For normal application code, you usually choose a preset and let the workspace build the backends.debug preset creates three backend instances: main, vec, and search.
2. Built-In Backend Families
HeavenBase ships backend builders for local, SQL, vector, file, and search use cases.| Family | Backend keys | Use it for |
|---|---|---|
| Local memory | inmem | Tests, demos, temporary rows. |
| Local files | json, pickle, file | Simple persistent local stores. |
| SQL rows | sqlite, duckdb, postgres, pgvector, mysql, oceanbase, mssql, oracle, trino, starrocks | Structured row storage and SQL-native filters. |
| Vector stores | lance, chroma, milvus, pinecone, pgvector | Native vector search. |
| Search | elasticsearch | Text search and search-engine-backed filters. |
debug or an explicit inmem/sqlite layout for examples and tests.
3. Configure a Custom Map
Explicit backend dictionaries use the workspace-local name as the key and the provider type inside the value.4. Discover Capabilities
Usehb.capabilities for globally registered options. Use ws.capabilities when you want the answer filtered through the workspace’s configured backend instances.
- which backends can store
Vector - which strategies work for
Array - which operations a backend can execute natively or with fallback
- whether a specific
dtype, operation, backend, and strategy combination is registered
5. Know the Safety Boundary
Workspace methods are thread-safe on oneHeavenBase instance. Current public operations are serialized by the workspace lock so schema registration, routing reads, CRUD, query, refresh, drop, audit, and repair do not race each other.
Persistent backends can be opened by multiple workspace instances when the provider supports that pattern. SQL backends rely on the database engine. File backends expose refresh() as an explicit cache invalidation hook after manual external edits.

