Use case ยท Customer support
A helpdesk without the service sprawl.
Tickets, conversations, customer profiles, help-center articles, SLA timers, notifications, and reports are documents and events. NonoDB keeps them in one place โ no separate search engine, queue, or reporting store.
The support desk is mostly a timeline
A ticket is a small state machine. The conversation, audit trail, and automation are append-only. That makes support a natural fit for documents, indexes, history, and outbox events.
Queues that stay fast
Index the fields agents filter on: status, priority, assignee, and last update.
One conversation per ticket
Append messages instead of rewriting a giant ticket document on every reply.
SLA automation
Workers scan an indexed due date and escalate before the customer notices.
Search that feels instant
BM25 for help-center articles and fuzzy matching for customer names.
Support feature map
| Support need | NonoDB feature | What you get |
|---|---|---|
| Ticket queues | Compound indexes | Filter by status, priority, assignee, and recency without scanning. |
| Conversation history | Append-only messages collection | A full timeline without one growing document per ticket. |
| Help center search | BM25 text index | Rank articles by relevance across a denormalized search_text field. |
| Customer lookup | Fuzzy index | Find a customer even when the name is misspelled. |
| SLA tracking | Indexed due date + workers | Escalate tickets before the deadline instead of running a full scan. |
| Notifications and webhooks | Transactional outbox events | Send email, chat, or webhook messages without dual writes. |
| Live queue | Watch and live subscriptions | New tickets appear instantly without polling. |
| Audit and quality review | Document history | See who changed status, priority, or assignment. |
| Reporting | SQL and aggregation | Tickets by status, agent load, and resolution trends. |
| Multi-tenant helpdesk | tenant_id plus vault collections | Query isolation per workspace; encrypt sensitive message bodies where required. |
| Existing integrations | MongoDB wire endpoint | Connect existing drivers and tools within the documented subset. |
| Operations | Backups, replication, GUI | Restore, fail over, and support the helpdesk from one system. |
The data model
Keep the ticket small. Put the conversation in messages, keep customer profiles separate, and let the event outbox handle side effects.
| Collection | Purpose | Useful fields |
|---|---|---|
| tickets | One row per conversation. | subject, requester_id, assignee_id, status, priority_rank, channel, tags, sla_due_at, resolved_at, updated_at |
| messages | Append-only conversation. | ticket_id, author_id, direction, channel, body, created_at |
| customers | Requester profile. | name, email, company, plan, tenant_id, created_at |
| articles | Help center content. | title, slug, body, search_text, published, tenant_id, updated_at |
| _events | Outbox for notifications and automation. | type, doc_id, payload, created_at |
Core support workflows
1. Create the queues
The agent inbox is a filtered, sorted list. Use a numeric priority rank so the sort is stable and index-friendly.
{"op":"create_indexes","coll":"tickets","indexes":[
{"fields":["tenant_id","status","priority_rank","updated_at"]},
{"fields":["tenant_id","assignee_id","status"]},
{"fields":["tenant_id","sla_due_at"]}
]}{"op":"find","coll":"tickets",
"filter":{"tenant_id":"acme",
"status":{"$in":["open","pending"]}},
"sort":[["priority_rank",1],["updated_at",-1]],
"limit":50}2. Load the conversation
Messages are append-only and indexed by ticket and time. The timeline is a range query, not a growing array inside the ticket.
{"op":"create_indexes","coll":"messages","indexes":[
{"fields":["tenant_id","ticket_id","created_at"]}
]}
{"op":"create_fuzzy_index","coll":"customers","field":"name"}
{"op":"create_text_index","coll":"articles","field":"search_text"}{"op":"find","coll":"messages",
"filter":{"tenant_id":"acme","ticket_id":"t_123"},
"sort":[["created_at",1]],
"limit":200}3. Escalate before the SLA expires
Store the deadline as a date, index it, and let a worker query the tickets that need attention. TTL is for temporary data, not for SLA timers.
{"op":"find","coll":"tickets",
"filter":{"tenant_id":"acme",
"status":{"$in":["open","pending"]},
"sla_due_at":{"$lte":"2026-05-01T12:00:00Z"}},
"sort":[["sla_due_at",1]],
"limit":100}4. Search the help center
Build one search_text field from the title, body, and tags. A NonoDB text index covers one field, which keeps ranking predictable. Fuzzy search helps agents find a customer before creating a duplicate.
{"op":"search","coll":"articles","field":"search_text",
"query":"refund policy","filter":{"tenant_id":"acme","published":true},
"limit":10}{"op":"fuzzy","coll":"customers","field":"name",
"query":"Kowalsky","max_distance":2,
"filter":{"tenant_id":"acme"},"limit":5}Automation and live queues
Enable collection events for the fields that matter: status, assignment, and priority. The event is written in the same transaction as the ticket update, so a notification cannot see a change that was rolled back.
{"op":"set_collection_events","coll":"tickets",
"enabled":true,"fields":["status","assignee_id","priority_rank"]}
{"op":"watch","coll":"_events","types":["tickets.update"],
"filter":{"payload.after.status":"resolved"},"after":"01J..."}For the agent inbox, a live subscription pushes new and changed tickets over one connection. No polling loop, no extra broker.
{"op":"watch","coll":"tickets","mode":"live",
"filter":{"status":"open"},"ops":["insert","update"],
"heartbeat_ms":10000}Event delivery is at-least-once. Make notification and webhook handlers idempotent so a retry does not send the same message twice.
Reporting and quality review
Use aggregation for the dashboard and SQL for ad-hoc reports. Enable history on tickets when supervisors need to see who changed status, priority, or assignment.
{"op":"aggregate","coll":"tickets","pipeline":[
{"$match":{"tenant_id":"acme"}},
{"$group":{"_id":"$status","tickets":{"$sum":1}}},
{"$sort":{"tickets":-1}}
]}Where another tool fits better
- Do not store attachments as large binary blobs. Keep metadata and object-store URLs in NonoDB.
- Do not put the whole conversation in the ticket document. Append messages.
- Do not use TTL for SLA deadlines. Use indexed dates and workers.
- Do not assume exactly-once events. Make handlers idempotent.
- Do not use a vault collection for fields agents need to search or sort.
Replace the queue, search, and reporting glue.