Database

Flexible JSONB collections with access rules, realtime subscriptions, and no predefined schema.

How it works

Koolbase Database stores records as JSONB in PostgreSQL. You define collections — like tables — from the dashboard, and each collection can hold any shape of JSON data without a fixed schema.

Each collection has three configurable access rules — read, write, and delete — that control who can perform each operation. Rules are enforced server-side on every request.

Your fields are returned at the top level of each record. System metadata lives in a reserved $-prefixed namespace: $id, $createdAt, $updatedAt, $collection, and $createdBy (the creator's user ID, present only when the write was authenticated). Field names beginning with $ are reserved and rejected on write.

Key concepts

CollectionA named group of records — equivalent to a table. Created from the dashboard.
RecordA single JSON document within a collection. Has a UUID id and timestamps automatically.
Access RuleControls who can read, write, or delete. Options: public, authenticated, or owner.
RealtimeSubscribe to live record changes over WebSocket — created, updated, and deleted events.
GIN IndexPostgreSQL GIN index on the JSONB data column for fast field-level queries.

Records are shared across environments

Collections and records are project-scoped, not environment-scoped. Your dev and prod environments read and write the same records — environments isolate API keys, feature flags, remote config, and version policy, not data. For true dev/prod data separation, use separate projects.

In this section

Database vs Storage

Use the Database for structured JSON data — user profiles, posts, settings, messages. Use Storage for files — images, documents, videos. Database records are not suitable for storing binary data or large blobs.