Skip to content
github-actions[bot] edited this page Jan 28, 2026 · 9 revisions

Welcome to the HybridDb documentation! This documentation provides comprehensive guidance for using HybridDb, a document database library built on SQL Server.

Table of Contents

Getting Started

  1. Getting Started - Introduction, installation, quick start, and core concepts
  2. How to Build and Contribute - Development setup, building, testing, and contribution guidelines

Configuration

  1. Connections and Testing - Connection strings, testing strategies, and environment-specific configuration
  2. Documents, Tables and Projections - Document configuration, table design, and property projections
  3. Events - Internal event handlers

Store and Transactions

  1. DocumentStore and DocumentTransaction - Store lifecycle, transaction management, and isolation levels

Working with Documents

  1. DocumentSession - Store and Load - Basic CRUD operations, entity states, and session lifecycle
  2. DocumentSession - Query - LINQ queries, raw SQL queries, and query optimization
  3. DocumentSession - Concurrency Model - Optimistic concurrency, ETags, and conflict detection
  4. DocumentSession - Advanced Scenarios - Metadata, ETags, deferred commands, and advanced patterns

Migrations

  1. Migrations - Schema migrations, document migrations, and migration patterns

Quick Links

Common Tasks

Installation

dotnet add package HybridDb

Basic Usage

var store = DocumentStore.ForTesting(TableMode.TempTables);
store.Document<Product>().With(x => x.Name);

using var session = store.OpenSession();

session.Store(new Product { Id = "p1", Name = "Widget" });
session.SaveChanges();

Querying

using var session = store.OpenSession();

var products = session.Query<Product>()
    .Where(x => x.Price > 100)
    .OrderBy(x => x.Name)
    .ToList();

Key Features

  • Simple API: Store and retrieve .NET objects with minimal configuration
  • LINQ Queries: Query documents using familiar LINQ syntax
  • Schema Evolution: Built-in migration support for schema and data changes
  • Transactions: Full ACID transaction support via SQL Server
  • Event Store: Optional event sourcing capabilities
  • Optimistic Concurrency: ETags for conflict detection
  • Polymorphism: Store and query document hierarchies
  • Projections: Index document properties for efficient querying

Learning Path

Beginners

  1. Start with Getting Started
  2. Learn about Connections and Testing
  3. Understand Documents and Projections
  4. Practice Store and Load operations

Intermediate

  1. Master Query capabilities
  2. Learn Migrations for schema evolution
  3. Understand Transactions
  4. Explore Advanced Scenarios

Advanced

  1. Implement Event Store patterns
  2. Build complex migration strategies
  3. Optimize query performance
  4. Understand Concurrency Model for production systems
  5. Contribute to the project with How to Build and Contribute

Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Your Application                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   DocumentSession                        β”‚
β”‚  (Unit of Work / First-level Cache)                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   DocumentStore                          β”‚
β”‚  (Configuration / Schema / Migrations)                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    SQL Server                            β”‚
β”‚  (Storage / Transactions / Indexes)                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Support and Resources

What's Next?


Documentation generated for HybridDb - A document database on SQL Server

Clone this wiki locally