原创 SpringBoot Mybatis 分庫分表 sharding
開源 https://github.com/letian-tang/mybatis-sharding.git 史上最簡潔的分庫分表中間件 基於SpringBoot+Mybatis的分庫分表 基於Mapper的切面 數據源默認使
原创 Slow query log日誌跟蹤
優化MySQL最重要的一部分工作是先確定”有問題”的查詢語句。只有先找出這些查詢較慢的sql查詢(執行時間較長),我們才能進一步分析原因並且優化它。MySQL爲我們提供了Slow Query Log記錄功能,它能記錄執行時間超過了特定時長
原创 RPC 分佈式事務的疑問
RPC +Zookeeper 基本上可以提供分佈式服務。 現在A系統 調用B系統,A系統需要更新本地狀態,同時需要調用B系統減少庫存。 我理解這是一個典型的分佈式事務。 但分佈式事務有自己的方案,比較典型的如:二階段提交,消息隊列。 我
原创 wowslider去除官方鏈接
刪除 V.css({"font-weight" : "normal","font-style" : "normal",padding : "1px 5px",margin : "0 0 0 0","border-radius" : "5p
原创 MySQL重置 Auto_increment字段起始值
有2種方法:1.alter table tbname auto_increment = x ;設置表tbname的唯一auto_increment字段起始值從x開始,如果此表數據量很多的話,這樣執行起來會很慢。2.truncate tb
原创 eureka服務註冊與發現
1、服務器發現的方式1.1 客戶端發現 客戶端查詢服務註冊表,使用負載均衡算法選擇一個實例,併發送請求。代表Zk、Eureka1.2 服務器端發現 服務器端自己維護一個服務註冊表,將request轉發到指定的服務。Eure
原创 mysql單表百萬記錄,limit分頁
對limit分頁問題的性能優化方法 利用表的覆蓋索引來加速分頁查詢 我們都知道,利用了索引查詢的語句中如果只包含了那個索引列(覆蓋索引),那麼這種情況會查詢很快。 因爲利用索引查找有優化算法,且數據就在查詢索引上面,不用再去找相關
原创 解決easyui 1.3.4之後版本 頁面加載後 validatebox默認校驗
在jquery.easyui.min.js中找到紅色部分 return this.each(function(){ var _406=$.data(this,"validatebox"); if(_406){ $.extend(_406
原创 replaceAll(String regex, String replacement)
replaceAll(String regex, String replacement) 第一個參數是正則表達式。 看下面代碼 template = template.replaceAll("[", "").replaceAll("]
原创 Spring @Cacheable指定失效時間
interface CacheNames{ String CACHE_15MINS = "sssss:cache:15m"; /** 30分鐘緩存組 */ String CACHE_30MINS = "s
原创 如果打成jar包,讀取classes下的文件怎麼寫
一般讀取classes下的資源文件 getClass().getResource("//").getPath()+"xxx.xml"; 如果打成jar包就不行了。通用方式如下 InputStream is = getClass().get
原创 spring工具類大全
spring工具類大全 AnnotatedElementUtils AnnotationBeanUtils AnnotationConfigContextLoaderUtils AnnotationConfigUtils Annot
原创 RPM安裝與卸載MySQL-5.6.27-1.linux*.x86_64.rpm*
http://blog.csdn.net/liu_yulong/article/details/50328447
原创 Mybatis on duplicate key update 不返回主鍵
<insert id="insertOrUpdate" parameterType="XXXX" useGeneratedKeys="true" keyProperty="id"> <include refid="insert
原创 spring aop 同一個bean中方法調用方法
@Component public class TestBean { public void a() { this.b(); } @Transactional pu