SmartSql = Dapper + MyBatis + Cache(Memory | Redis) + ZooKeeper + R/W Splitting + ......
SmartSql
Why
- 拥抱 跨平台 DotNet Core,是时候了。
- 高性能、高生产力,超轻量级的ORM。156kb (Dapper:168kb)
So SmartSql
- TargetFrameworks: .NETFramework 4.6 & .NETStandard 2.0
- SmartSql = SmartSql = MyBatis + Cache(Memory | Redis) + ZooKeeper + R/W Splitting +Dynamic Repository + ......
主要特性
- 1 ORM
- 1.1 Sync
- 1.2 Async
- 2 XmlConfig & XmlStatement -> Sql
- 2.1 SmartSqlMapConfig & SmartSqlMap (是的,你猜对了,和MyBatis一样,通过XML配置分离SQL。)
- 2.2 Config Hot Update ->ConfigWatcher & Reload (配置文件热更新:当你需要修改Sql的时候,直接修改SqlMap配置文件,保存即可。)
- 3 读写分离
- 3.1 读写分离
- 3.2 多读库 权重筛选 (配置多读库,根据读库权重选举读库)
- 4 日志
- 4.1 基于 Microsoft.Extensions.Logging.Abstractions (当你需要跟踪调试的时候一切都是那么一目了然)
- 5 Dynamic Repository
- 5.1 SmartSql.DyRepository (解放你的双手,你来定义仓储接口,我来实现数据库访问)
- 6 查询缓存 (热数据缓存,一个配置轻松搞定)
- 6.1 SmartSql.Cache.Memory
- 6.1.1 Fifo
- 6.1.2 Lru
- 6.2 SmartSql.Cache.Redis
- 6.3 缓存事务一致性
- 6.1 SmartSql.Cache.Memory
- 7 分布式配置插件
- 7.1 IConfigLoader (配置文件加载器)
- 7.2 LocalFileConfigLoader (本地文件配置加载器)
- 7.2.1 Load SmartSqlMapSource Xml
- 7.3.1 Load SmartSqlMapSource Directory
- 7.3 SmartSql.ZooKeeperConfig (ZooKeeper 分布式配置文件加载器)
性能评测
BenchmarkDotNet=v0.10.14, OS=Windows 10.0.17134
Intel Core i7-6700K CPU 4.00GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=2.1.201
[Host] : .NET Core 2.0.7 (CoreCLR 4.6.26328.01, CoreFX 4.6.26403.03), 64bit RyuJIT
DefaultJob : .NET Core 2.0.7 (CoreCLR 4.6.26328.01, CoreFX 4.6.26403.03), 64bit RyuJIT
ORM | Type | Method | Return | Mean | Error | StdDev | Rank | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|---|---|
Native | NativeBenchmarks | Query_GetValue_DbNull | IEnumerable`1 | 78.39 ms | 0.8935 ms | 0.7921 ms | 1 | 3000.0000 | 1125.0000 | 500.0000 | 15.97 MB |
SmartSql | SmartSqlBenchmarks | Query | IEnumerable`1 | 78.46 ms | 0.2402 ms | 0.1875 ms | 1 | 2312.5000 | 1000.0000 | 312.5000 | 12.92 MB |
SmartSqlDapper | SmartSqlDapperBenchmarks | Query | IEnumerable`1 | 78.65 ms | 1.2094 ms | 1.1312 ms | 1 | 3687.5000 | 1437.5000 | 687.5000 | 19.03 MB |
Native | NativeBenchmarks | Query_IsDBNull_GetValue | IEnumerable`1 | 78.84 ms | 0.8984 ms | 0.7502 ms | 1 | 2312.5000 | 1000.0000 | 312.5000 | 12.92 MB |
Dapper | DapperBenchmarks | Query | IEnumerable`1 | 79.00 ms | 1.0949 ms | 0.9706 ms | 1 | 3312.5000 | 1312.5000 | 625.0000 | 17.19 MB |
EF | EFBenchmarks | Query | IEnumerable`1 | 79.44 ms | 1.6880 ms | 1.5789 ms | 1 | 6250.0000 | - | - | 26.05 MB |
SqlSugar | SqlSugarBenchmarks | Query | IEnumerable`1 | 81.09 ms | 0.8718 ms | 0.7728 ms | 2 | 2187.5000 | 875.0000 | 250.0000 | 12.64 MB |
Chloe | ChloeBenchmarks | Query | IEnumerable`1 | 83.86 ms | 1.2714 ms | 1.1893 ms | 3 | 2250.0000 | 937.5000 | 312.5000 | 12.62 MB |
EF | EFBenchmarks | SqlQuery | IEnumerable`1 | 89.11 ms | 0.7562 ms | 0.6314 ms | 4 | 8187.5000 | 125.0000 | - | 33.68 MB |
EF | EFBenchmarks | Query_NoTracking | IEnumerable`1 | 93.13 ms | 0.8458 ms | 0.7912 ms | 5 | 5875.0000 | 2250.0000 | 1062.5000 | 29.71 MB |
EF | EFBenchmarks | SqlQuery_NoTracking | IEnumerable`1 | 106.89 ms | 1.0998 ms | 1.0288 ms | 6 | 7437.5000 | 2875.0000 | 1312.5000 | 37.34 MB |
Nuget Packages
Package | NuGet Stable | Downloads |
---|---|---|
SmartSql | ||
SmartSql.TypeHandler | ||
SmartSql.DyRepository | ||
SmartSql.DIExtension | ||
SmartSql.Cache.Redis | ||
SmartSql.ZooKeeperConfig | ||
SmartSql.Options |
示例项目
文档地址
技术交流
点击链接加入QQ群【SmartSql 官方交流群】:604762592
SmartSql = Dapper + MyBatis + Cache(Memory | Redis) + ZooKeeper + R/W Splitting + ......的更多相关文章
- 【OF框架】框架Cache/Session在负载均衡部署时,切换Memory/Redis测试
一.切换Memory/Redis 第一步:安装运行Redis服务,获得连接参数. 第二步:在appsettings.json中配置 EnableRedisCache 和 Redisconnection ...
- SpringMVC+Mybatis+MySQL配置Redis缓存
SpringMVC+Mybatis+MySQL配置Redis缓存 1.准备环境: SpringMVC:spring-framework-4.3.5.RELEASE-dist Mybatis:3.4.2 ...
- SpringBoot之Mybatis操作中使用Redis做缓存
上一博客学习了SpringBoot集成Redis,今天这篇博客学习下Mybatis操作中使用Redis做缓存.这里其实主要学习几个注解:@CachePut.@Cacheable.@CacheEvict ...
- Spring Boot(八)集成Spring Cache 和 Redis
在Spring Boot中添加spring-boot-starter-data-redis依赖: <dependency> <groupId>org.springframewo ...
- Virtual address cache memory, processor and multiprocessor
An embodiment provides a virtual address cache memory including: a TLB virtual page memory configure ...
- 完整SpringBoot Cache整合redis缓存(二)
缓存注解概念 名称 解释 Cache 缓存接口,定义缓存操作.实现有:RedisCache.EhCacheCache.ConcurrentMapCache等 CacheManager 缓存管理器,管理 ...
- django自带cache结合redis创建永久缓存
0916自我总结 django自带cache结合redis创建永久缓存 1.redis库 1.安装redis与可视化操作工具 1.安装redis https://www.runoob.com/redi ...
- MyBatis源码分析(五):MyBatis Cache分析
一.Mybatis缓存介绍 在Mybatis中,它提供了一级缓存和二级缓存,默认的情况下只开启一级缓存,所以默认情况下是开启了缓存的,除非明确指定不开缓存功能.使用缓存的目的就是把数据保存在内存中,是 ...
- MyBatis Cache配置
@(MyBatis)[Cache] MyBatis Cache配置 MyBatis提供了一级缓存和二级缓存 配置 全局配置 配置 说明 默认值 可选值 cacheEnabled 全局缓存的开关 tru ...
随机推荐
- 阿里云消息队列(MQ)服务
A.首先在阿里云上申请消息队列MQ服务: B.然后创建一个Topic(主题,一级主题):然后创建生产者与消费者: C.不过此时还没有结束 ,还需要创建一个AccessKey和AccessSecret( ...
- Python列表,字典和字符串操作
列表: 列表:list, 也叫数组,表现[].特点:有角标,元素可以重复,有序的元素 例子:stus = ['王志华','乔美玲','乔美玲','王文文','feixiang']#中括号,这就是一个l ...
- [LeetCode] Find And Replace in String 在字符串中查找和替换
To some string S, we will perform some replacement operations that replace groups of letters with ne ...
- MySql操作(一)
1.连接Mysql 格式: mysql -h主机地址 -u用户名 -p用户密码 1.连接到本机上的MYSQL.首先打开DOS窗口,然后进入目录mysql\bin,再键入命令mysql -u root ...
- linux mysql 安装
操作系统 Centos 7.2以上版本 操作系统 centos 7.2以上版本 mysql 版本 mysql-5.7.23-el7-x86_64.tar.gz 1.1 安装准备 1. 创建安装文件存 ...
- C#线程的使用(1)
今天刚开始学习使用线程,把学习过程与新的记录下来. 创建线程: 非常简单,只需声明她并为其提供线程起始点处的方法委托即可: 终止线程: 使用Abort和Join方法来实现: Abort方法:用于永久的 ...
- 十八、泛型 l 注解 l Servlet3.0 l 动态代理 l 类加载器基础加强
l 泛型 l 注解 l Servlet3.0 l 动态代理 l 类加载器 泛型 1 回顾泛型类 泛型类:具有一个或多个泛型变量的类被称之为泛型类. public class A<T> { ...
- Ubunto使用 码云 创建项目
1.安装 git sudo apt-get install git配置 git 文件 git config --global user.name "你的用户名" git confi ...
- lua语言自学知识点----Lua与.Net相互调用
知识点: LuaInterface作用是用来完成Lua与C#的相互调用. LuaInterface核心库:1.luainterface.dll 用于C#读取lua(放在bin目录同级) 2.luane ...
- 欢迎访问我的独立博客 tracefact.net (2019.1.30)
欢迎访问我的独立博客 tracefact.net 长期以来,我都同时维护着两个博客,博客园和 tracefact.net,感觉有点分散精力,所以博客园以后不再每篇文章都同步更新了. 我会挑个别比较好的 ...