ormDB

ormDB for E-Commerce

ormDB eliminates N+1 queries on e-commerce product pages through graph fetches that load products with variants, reviews, and related items in a single round-trip. Built-in BM25 full-text search replaces the need for Elasticsearch, and change streams provide real-time inventory updates.

Industry: E-Commerce

E-commerce data is deeply relational

A single product page might need: the product, its variants (size, color), images, reviews with authors, related products, inventory levels, and pricing rules. With PostgreSQL and an ORM, that’s 7+ separate queries — the classic N+1 problem.

ormDB for product catalogs

ormDB is a relational database engine that loads entire product graphs in one round-trip. Define your product entity with relations to variants, images, and reviews. A single graph fetch returns the complete product page data as structured entity blocks.

Full-text search is built in. BM25-ranked search with phrase matching means you don’t need Elasticsearch for product search. Your product catalog and search index live in one database.

Change streams push real-time inventory updates. When stock levels change, ormDB emits events that your storefront can subscribe to — no polling, no stale inventory displays.

ACID transactions ensure order processing integrity. Payment, inventory deduction, and order creation happen atomically.

A product page in one query

The whole product detail page loads as a single graph fetch, no matter how many relations it touches:

graph_fetch Product (slug = "trail-runner-gtx") {
  name, description, priceCents,
  variants { sku, size, color, inventoryCount },
  images [order: position] { url, alt },
  reviews [limit: 20, order: createdAt desc] {
    rating, body,
    author { name }
  },
  relatedProducts [limit: 8] { name, slug, priceCents }
}

Against a SQL database and an ORM, that same page is the classic 7-plus query fan-out. With ormDB it is one round-trip returned as structured entity blocks.

Honest tradeoffs

ormDB is in Alpha (v0.1.0), so a high-volume production storefront that needs battle-tested reliability, mature payment-provider integrations, and a deep operational ecosystem should weigh PostgreSQL or a managed platform today. ormDB shines when relationship-heavy catalog pages, native product search, and real-time inventory are the parts of your stack causing the most pain — and it lets you consolidate the catalog, search index, and change feed into one engine instead of three.

Frequently Asked Questions

Can ormDB replace Elasticsearch for product search?

For most e-commerce search needs, yes. ormDB includes BM25-ranked full-text search with phrase matching and boolean queries built in. You don't need a separate search infrastructure for product catalog search.

How does ormDB handle product pages with many relations?

A product page with variants, images, reviews, and related products loads in one graph fetch. ormDB returns the entire product graph in a single round-trip.

How does ormDB keep checkout consistent?

Checkout writes — deducting inventory, creating the order, recording payment, and writing line items — run inside a single ACID transaction. If any step fails, the whole thing rolls back, so you never oversell stock or create an order with no payment record.

Can ormDB power storefront personalization and recommendations?

Yes. ormDB includes HNSW vector search, so you can store product or user embeddings alongside relational data and run similarity queries for 'related products' or personalized recommendations without a separate vector database like Pinecone.

How does real-time inventory work without polling?

Change streams emit a delta event with a version token whenever a stock level changes. Your storefront subscribes to those events and updates the affected product's availability instantly, instead of polling the database on a timer.

Related Content

Try ormDB today

Open source, MIT licensed. Install and start building.