Use case · Internal tools
Internal apps, without a platform team.
Admin panels, approvals, settings, audit trails, scheduled jobs, and live dashboards are mostly documents and background work. NonoDB gives teams one database and one console instead of five services to glue together.
Internal tools are a database and a few loops
Most internal apps are CRUD screens plus approvals, an audit trail, a scheduled job, and a notification. The database should make those boring, not turn every tool into a platform project.
Model the request
Each tool has its own fields. Store them as documents instead of planning a migration for every form change.
Protect the transition
Approve from a pending state with one atomic operation, so a double click cannot approve twice.
Keep the audit trail
History shows who changed what, and the GUI lets support inspect it without a custom admin screen.
Run the background work
Claim a queued job atomically, run it, record the result, and retry safely.
Internal tools feature map
| Internal need | NonoDB feature | What you get |
|---|---|---|
| Admin panels | JSON documents and indexes | Model each internal tool without a schema migration. |
| Approval queues | Compound indexes | Filter by status, assignee, priority, and age. |
| Safe approvals | Atomic find_and_modify | Approve only from a pending state; concurrent clicks cannot double-approve. |
| Audit and undo | Document history | See every revision and restore a bad configuration change. |
| Background jobs | Jobs collection + atomic claim | Workers claim queued jobs without two workers running the same one. |
| Notifications | Transactional outbox events | Send chat, email, or webhook messages from committed changes. |
| Live dashboards | Watch and live subscriptions | Pending work and status changes appear without polling. |
| Search | Text and fuzzy indexes | Find requests, customers, or records by title and approximate name. |
| Reporting | SQL and aggregation | Counts by status, team, or period without an export. |
| Access control | Principals, tokens, and certificates | Scope internal tools to the right users and services. |
| Existing tools | MongoDB wire endpoint | Connect existing drivers and admin scripts inside the supported subset. |
| Operations | Backups, replication, GUI | Restore, fail over, and support the tool from one system. |
The data model
A request collection covers most workflows. Add jobs for durable work and audit_log for business-level history that should outlive a single record.
| Collection | Purpose | Useful fields |
|---|---|---|
| requests | Approvals, access requests, purchases. | title, type, requester_id, assignee_id, status, priority_rank, payload, created_at, approved_at |
| jobs | Durable background work. | type, state, priority_rank, run_at, attempts, payload, started_at, finished_at |
| audit_log | Append-only business audit. | actor_id, action, target, before, after, created_at |
| settings | Per-tenant configuration. | tenant_id, key, value, updated_by, updated_at |
| _events | Outbox for notifications and integrations. | type, doc_id, payload, created_at |
Core internal workflows
1. Build the request queue
Internal queues are filtered lists. Index the tenant, status, assignee, and age fields so the page stays fast as the backlog grows.
{"op":"create_indexes","coll":"requests","indexes":[
{"fields":["tenant_id","status","created_at"]},
{"fields":["tenant_id","assignee_id","status"]}
]}
{"op":"create_indexes","coll":"jobs","indexes":[
{"fields":["tenant_id","state","priority_rank","run_at"]}
]}{"op":"find","coll":"requests",
"filter":{"tenant_id":"acme","status":"pending"},
"sort":[["created_at",1]],
"limit":50}2. Approve exactly once
Use a conditional find_and_modify. If the request is no longer pending, nothing matches and the operation returns null instead of overwriting another decision.
{"op":"find_and_modify","coll":"requests",
"filter":{"_id":"req_123","tenant_id":"acme","status":"pending"},
"update":{"$set":{"status":"approved","approved_by":"u_9"},
"$currentDate":{"approved_at":true}},
"new":true}3. Keep an audit trail
Enable history on records that need undo or compliance review. For business events that span several records, append an audit_log document in the same write batch as the change.
{"op":"set_collection_history","coll":"requests","max_versions":100}
{"op":"history","coll":"requests","id":"req_123",
"limit":50,"include_docs":true}4. Run durable background jobs
A worker claims the oldest eligible job atomically. The state transition from queued to running happens once, even with several workers.
{"op":"find_and_modify","coll":"jobs",
"filter":{"tenant_id":"acme","state":"queued",
"run_at":{"$lte":"2026-05-01T12:00:00Z"}},
"sort":[["priority_rank",1],["run_at",1]],
"update":{"$set":{"state":"running"},
"$inc":{"attempts":1},
"$currentDate":{"started_at":true}},
"new":true}Events, live views, and reporting
Enable events for the fields that should trigger a notification or an external integration. The event commits with the request, so a webhook never sees a change that was rolled back.
{"op":"set_collection_events","coll":"requests",
"enabled":true,"fields":["status","assignee_id"]}
{"op":"watch","coll":"_events","types":["requests.update"],
"filter":{"payload.after.status":"approved"},"after":"01J..."}For an operations dashboard, a live subscription pushes new and changed requests over one connection. No polling loop and no extra broker.
{"op":"watch","coll":"requests","mode":"live",
"filter":{"status":"pending"},"ops":["insert","update"],
"heartbeat_ms":10000}Use aggregation for the dashboard and SQL for ad-hoc reports. The same data serves both.
{"op":"aggregate","coll":"requests","pipeline":[
{"$match":{"tenant_id":"acme"}},
{"$group":{"_id":"$status","requests":{"$sum":1}}},
{"$sort":{"requests":-1}}
]}Where another tool fits better
- Do not use TTL for pending approvals. Use TTL only for temporary exports, sessions, and caches.
- Do not run arbitrary user code inside the daemon. Use workers outside the database.
- Do not use a vault collection for records the admin UI must search or sort.
- Do not assume exactly-once events. Make notification and webhook handlers idempotent.
- Do not store large files in documents. Keep object-store URLs and metadata.
One database for the internal long tail.