ormDB

Best Database for TypeScript Projects

ormDB is a relational database engine written in Rust that replaces PostgreSQL, MySQL, or SQLite for TypeScript projects. Its graph-fetch query model returns nested object hierarchies that align with TypeScript interfaces, eliminating N+1 queries. It works with existing TypeScript ORMs like Prisma and is in Alpha v0.1.0 under the MIT license.

Why TypeScript Projects Deserve a Database That Thinks in Objects

TypeScript developers write code in terms of interfaces, nested objects, and typed hierarchies. Then they hit the database layer and everything flattens into rows, joins, and SQL strings. ORMs help, but they cannot fix the fundamental mismatch between how TypeScript represents data and how traditional databases store it.

ormDB is a relational database engine written in Rust that replaces PostgreSQL, MySQL, or SQLite. It is not an ORM. It is the actual database your TypeScript application connects to. You keep your existing ORM (Prisma, Drizzle, TypeORM) and swap the database underneath.

The TypeScript-Database Impedance Mismatch

TypeScript interfaces describe nested, typed object graphs. A User has posts, each post has comments, each comment has an author. In TypeScript, this is one type definition. In SQL, this is four tables, three foreign keys, and either a complex join or multiple sequential queries. ormDB’s graph-fetch model lets you describe the shape of data you need and returns the entire object graph in a single round-trip.

N+1 Queries Are a TypeScript Problem

Every TypeScript ORM struggles with N+1 queries. Prisma’s include, TypeORM’s relations, Drizzle’s with — they all generate multiple SQL queries under the hood. ormDB eliminates this at the database level. A graph fetch is a single operation that returns all related entities, no matter how deep the hierarchy.

Zero-Copy Performance

ormDB’s wire protocol uses rkyv for zero-copy deserialization. When your TypeScript runtime receives data from ormDB, the serialization overhead is minimal compared to the JSON parsing and row-to-object mapping that traditional database drivers require.

Built-In Capabilities TypeScript Devs Typically Add Separately

TypeScript projects commonly integrate separate services for search (Elasticsearch), real-time updates (Redis Pub/Sub), and vector embeddings (Pinecone). ormDB includes full-text search, change streams, and vector search natively. This reduces the number of services your TypeScript application depends on and simplifies your deployment architecture.

Safe Migrations for Fast-Moving TypeScript Teams

TypeScript projects iterate quickly. ormDB grades every migration from A to D based on safety, giving your team confidence to evolve the schema without risking data loss or downtime. ACID transactions guarantee consistency even during rapid development cycles.

For TypeScript developers who want a database that matches the way they think about data, ormDB provides a native object-graph query model with the relational guarantees their applications require.

Frequently Asked Questions

Does ormDB have a TypeScript client?

ormDB is designed to work with existing ORMs that TypeScript developers already use, such as Prisma. You keep your ORM and swap the database underneath to ormDB.

How does ormDB handle TypeScript object graphs?

ormDB's graph-fetch query model returns entire object hierarchies in a single round-trip. The shape of the returned data matches how TypeScript interfaces naturally describe nested objects.

Is ormDB faster than PostgreSQL for TypeScript apps?

ormDB eliminates N+1 queries through graph fetches and uses a zero-copy wire protocol (rkyv) that reduces serialization overhead. For relationship-heavy TypeScript applications, this translates to fewer round-trips and lower latency.

Can I use Prisma with ormDB?

Yes. ormDB is designed as a database engine replacement. Prisma users can point their Prisma client at ormDB instead of PostgreSQL or MySQL.

What query language does ormDB use with TypeScript?

ormDB uses an entity/relation/graph-fetch query language instead of SQL. This is accessed through your existing ORM layer, so your TypeScript code continues to use the ORM's query builder.

Does ormDB support real-time subscriptions for TypeScript apps?

Yes. ormDB includes built-in change streams (CDC) that enable real-time data subscriptions without external tools or services.

What is ormDB's current status?

ormDB is in Alpha v0.1.0, MIT licensed, built by incredlabs. It is suitable for evaluation and early-stage TypeScript projects.

Related Content

Try ormDB today

Open source, MIT licensed. Install and start building.