# dotnetcore/SmartSql

SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack  +Dynamic Repository + InvokeSync + Diagnostics

Repository: https://github.com/dotnetcore/SmartSql
Canonical: https://ross.abutalabs.com/products/smartsql
Homepage: https://wiki.smartsql.net/
Language: C#
License: Apache-2.0
License Family: permissive
Topics: orm, dotnet-core, cross-platform, high-performance, distributed-computing, redis, zookeeper, read-write-separation, cache, sql, smartsql, dotnet, dotnetcore, mybatis, sqlserver, mysql, sqlite, postgresql, skywalking, oracle
Last push: 2026-08-25T21:43:41+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 60, longevity 100
- inputs: {"age_days": 3441, "days_push": 8, "days_rel": 111, "gap_med": 156, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1131, forks 229 (observed 2026-08-28T04:03:42.465331+00:00)

## What it is
SmartSql is a MyBatis-inspired ORM for .NET that manages SQL in XML files with dynamic conditional tags, giving developers full control over generated SQL. It bundles caching (memory and Redis), read/write splitting with load balancing, IL-emit dynamic repositories, and diagnostics for APM integration.

## Use cases
- manage SQL statements in XML instead of inline strings or LINQ
- write hand-tuned SQL with conditional tags instead of ORM-generated queries
- split reads and writes across database replicas with weighted load balancing
- cache query results in memory or Redis with automatic invalidation
- auto-implement repository interfaces from SQL statement naming conventions
- monitor SQL execution with DiagnosticSource and SkyWalking integration
- generate partial UPDATE statements that only modify changed properties

## When to choose
- you want MyBatis-style XML-managed SQL in a .NET application
- you need absolute control over SQL for performance-critical complex queries
- you want built-in read/write splitting and distributed caching without extra libraries
- you prefer convention-based repositories with minimal boilerplate

## When to avoid
- you prefer LINQ-based ORMs like Entity Framework for code-first modeling
- you want a lightweight micro-ORM like Dapper without XML configuration
- your team dislikes maintaining SQL in XML files

## Facets
- artifact type: library
- maturity: active
- function: orm, caching, database, monitoring, serialization
- domain: databases, backend, web-development, developer-tools, microservices
- platform: dotnet, cross-platform, windows
- tags: mybatis-inspired, xml-sql-management, read-write-splitting, dynamic-repository, redis-cache, sql-mapper, diagnostics, apm-integration, linux, macos

## Member repositories
- dotnetcore/SmartSql (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:42.465331+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:38:01.989811+00:00, confidence not recorded.
  - readme: https://github.com/dotnetcore/SmartSql (fetched 2026-08-28T04:03:42.465331+00:00, sha e764516ec8c7)
  - homepage: https://wiki.smartsql.net/ (fetched 2026-08-29T12:42:27.093402+00:00, sha d3ee299ecfb4)
  - site_page: https://wiki.smartsql.net/guide/changelog (fetched 2026-08-29T12:42:27.102385+00:00, sha a8538fc27fea)
- Data as of 2026-08-30T08:39:29.467469+00:00.
