A high-performance .NET data access layer inspired by MyBatis, offering XML-managed SQL, caching, read/write splitting, and dynamic repositories.
SmartSql is a .NET data access framework inspired by MyBatis that gives developers full control over SQL through XML configuration. It solves the problem of complex, hard-to-optimize LINQ queries by allowing direct SQL management while providing features like caching, read/write splitting, and dynamic repositories to improve performance and maintainability.
.NET developers building data-intensive applications who need fine-grained SQL control, high performance, and scalable data access patterns without the overhead of traditional ORMs.
Developers choose SmartSql for its balance of SQL control and developer productivity, offering MyBatis-like flexibility in the .NET ecosystem with built-in caching, monitoring, and repository automation that outperforms raw ADO.NET approaches.
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Centralizes SQL in XML files, allowing developers to write and optimize queries directly without LINQ abstraction layers, as highlighted in the philosophy section for absolute control.
Reduces boilerplate code by automatically implementing repository interfaces via naming conventions and integrating seamlessly with IoC containers, as shown in the DyRepository examples.
Includes memory caches (LRU, FIFO) and Redis integration with configurable policies, improving performance for high-throughput systems, as detailed in the caching section.
Offers read/write splitting, ID generation (Snowflake), and SkyWalking monitoring for diagnostics, making it suitable for microservices and enterprise environments.
Requires managing SQL in external XML files, which can be cumbersome for refactoring and less intuitive for developers accustomed to code-first or inline SQL approaches.
Involves multiple NuGet packages and tools like SmartCode for best practices, adding a non-trivial configuration burden that may slow down project onboarding.
Has a smaller community and fewer third-party integrations compared to mainstream ORMs like Entity Framework, potentially making troubleshooting and resource finding more difficult.
SmartSql is an open-source alternative to the following products:
EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
.NET aot orm, VB.NET/C# orm, Mysql/PostgreSQL/SqlServer/Oracle orm, Sqlite/Firebird/Clickhouse/DuckDB orm, 达梦/金仓/虚谷/翰高/高斯 orm, 神通 orm, 南大通用 orm, 国产 orm, TDengine orm, QuestDB orm, MsAccess orm.
Entity Framework EF Core efcore Bulk Batch Extensions with BulkCopy in .Net for Insert Update Delete Read (CRUD), Truncate and SaveChanges operations on SQL Server, PostgreSQL, MySQL, SQLite, Oracle
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.