A .NET library that uses PostgreSQL as a transactional document database and ACID-compliant event store.
Marten is a .NET library that transforms PostgreSQL into a transactional document database and event store. It allows developers to store and query .NET objects as JSON documents directly in PostgreSQL, and provides a robust, ACID-compliant foundation for event-sourced architectures. It solves the problem of needing separate databases for document storage and event sourcing by unifying them on a proven relational engine.
.NET developers building applications that benefit from document-oriented data persistence, event-driven architectures, or who want to leverage PostgreSQL for more than traditional relational modeling.
Developers choose Marten for its unique combination of PostgreSQL's reliability with the flexibility of a document database and the power of an event store, all within a single, familiar technology stack. It reduces infrastructure complexity and boosts productivity by providing a .NET-first API for these patterns.
.NET Transactional Document DB and Event Store on PostgreSQL
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Marten leverages PostgreSQL's robust JSONB support and ACID transactions, providing a reliable foundation for document storage and event sourcing without sacrificing database integrity.
It combines document database flexibility with event store capabilities in a single library, reducing infrastructure complexity for .NET applications that need both patterns.
Features like native patching for partial updates and a .NET-first API minimize boilerplate code, speeding up development compared to traditional ORMs.
Active Discord channels, GitHub discussions, and optional paid support from JasperFx ensure reliable assistance and ongoing project maintenance.
Marten is tightly coupled to PostgreSQL, meaning you cannot easily switch to other database systems without significant rework or data migration.
The library is deprecating PLV8 for JavaScript-based patching and projections, forcing existing users to migrate to native patching, which may require code changes and testing.
Initial setup requires configuring PostgreSQL with specific versions (13+) and potentially enabling extensions, which can be cumbersome compared to cloud-native document databases with simpler provisioning.