Introduction
Welcome to the Polecat documentation!
What is Polecat?
Polecat is a .NET library for building applications using a document-oriented database approach and Event Sourcing, backed by SQL Server 2025.
Polecat is part of the Critter Stack ecosystem and mirrors the API patterns of Marten (the PostgreSQL equivalent), making it easy for teams already familiar with Marten to adopt SQL Server as their backing store.
TIP
If you've used Marten before, you'll feel right at home with Polecat. The API surface is intentionally similar -- same interface names, same session patterns, same projection model.
Under the hood, Polecat is built on top of SQL Server 2025, leveraging its native JSON type to provide:
- a document database,
- an event store.
Polecat uses SQL Server 2025's native JSON data type for storing document bodies, event data, headers, and snapshots. Combined with modern T-SQL features, this provides strong data consistency for both document storage and event sourcing approaches.
Main Features
| Feature | Description |
|---|---|
| Document Storage | Store your entities as JSON documents in SQL Server with full LINQ querying support. |
| Event Store | Full-fledged event store for Event Sourcing with stream management, projections, and subscriptions. |
| Strong Consistency | Uses SQL Server transactions for ACID compliance across both document and event operations. |
| LINQ Querying | Filter documents using LINQ queries with string searching, child collection queries, paging, and more. |
| Event Projections | Build read models from events using inline, async, or live projection strategies. |
| Automatic Schema Management | Polecat manages SQL Server table creation and migrations automatically via Weasel.SqlServer. |
| Optimistic Concurrency | Built-in support for both Guid-based and numeric revision concurrency control. |
| Multi-Tenancy | Multiple tenancy strategies: conjoined (same tables), separate databases, or single tenant. |
| Async Daemon | Background projection processing for eventually consistent read models. |
| EF Core Integration | Use Entity Framework Core DbContext within your event projections. |
Critter Stack Ecosystem
Polecat is designed to work alongside other Critter Stack libraries:
| Library | Purpose |
|---|---|
| Marten | PostgreSQL document database and event store |
| Wolverine | Messaging and command processing framework |
| JasperFx | Core framework and event sourcing abstractions |
| Weasel | Database schema management |
Polecat vs Marten
Polecat mirrors Marten's API but targets SQL Server 2025 instead of PostgreSQL:
| Feature | Marten (PostgreSQL) | Polecat (SQL Server) |
|---|---|---|
| JSON storage | jsonb type | json type (SQL Server 2025) |
| Sequences | bigserial / sequences | bigint IDENTITY(1,1) |
| Upsert | INSERT ... ON CONFLICT | MERGE statement |
| Change notification | LISTEN/NOTIFY | Polling (configurable interval) |
| Advisory locks | pg_advisory_lock | sp_getapplock / sp_releaseapplock |
| Timestamps | timestamptz | datetimeoffset |
| Serialization | STJ or Newtonsoft | System.Text.Json only |
History and Origins
The project name Polecat follows the Critter Stack tradition of naming projects after animals. A polecat is a member of the mustelid family -- close relatives of the marten, making it a fitting name for Marten's SQL Server cousin.

JasperFx provides formal support for Polecat and other Critter Stack libraries. Please check our