All primitives

Data / flexible records

Document Database

Give your application a memory. A document database keeps the information your app needs to work—organized in flexible records that can grow with your idea.

The idea

Imagine an app that helps people organize personal projects. Each project has a name, description, tasks, notes, attachments, and settings. Those details need somewhere to live so they are still there tomorrow. A document database stores each project as a flexible, self-contained record.

Interactive demo

My Projects

A tiny app with a database behind it.

Renovate my apartment

12 tasks · Updated just now

Launch my startup

8 tasks · Updated yesterday

Plan a trip to Japan

5 tasks · Updated Monday

Try it: Add a project, then refresh or reset. This demo keeps new entries in temporary page state. A real document database saves them so they are still here tomorrow.

Demo data · not persisted

1 · Input

Project form

Name, notes, settings

2 · Shape

JSON document

One project, one record

3 · Result

Database → project card

Saved and ready next time

Good for

  • User profiles and preferences
  • Content and CMS records
  • Agent state and memory

Implementation notes

  • Create a collection for each bounded domain.
  • Validate document shape at the edge of your function.
  • Add indexes only for fields you query frequently.

Implementing it

With a coding agent

Ask your agent to add a document database

Agent setup (mock link)

Copy this prompt, fill in the bracketed details, and paste it into your coding agent. It describes the goal, the records to store, and the guardrails.

Bracketed text marks details only you can fill in. 853 / 6,000 characters.

Fill in:APP OR PRODUCTWHAT THE APP SHOULD REMEMBERFIELDS AND NESTED DETAILSEACH KIND OF RECORDFIELDS TO FILTER OR SORT BYUSER, WORKSPACE, OR TENANTIMPORTANT CREATE, UPDATE, AND ACCESS CASES

Good foundation · 72/100

Traditional SDK / API

Save a project record

TypeScript
const profile = await ultrahost.documents.create("profiles", {
  userId,
  displayName: "Ada",
  preferences: { theme: "system" },
})

Key takeaway

A Document Database remembers the information your application needs to work.

Next primitive

Timeseries Database