原创 springcloud zuul搭建服務器接口網關
加入依賴;<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zuul</artifactId>
原创 小談高併發
在開發高併發系統時有三把利器用來保護系統:緩存、降級和限流。本文結合作者的一些經驗介紹限流的相關概念、算法和常規的實現方式。 緩存 緩存比較好理解,在大型高併發系統中,如果沒有緩存數據庫將分分鐘被爆,系統也會瞬間癱瘓。使用緩存不單單能夠提
原创 mybatis helloWorld
mybatis是一個半自動的輕量級框架,優點是可以將sql交給開發人員編寫,具有靈活性配置mybatis-config.xml<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE config
原创 redis 1+5 常用指令
鍵(key): keys * exists key的名字,判斷某個key是否存在 move key db 移除當前庫 expire key秒,給當前key設置過期時間 ttl key 查看當前Key還有多少秒過期,-1表示永不過期
原创 windows 安裝mongodb及可視化robo 3t
mongodb 下載地址:https://www.mongodb.com/download-center#community選擇windows版下載安裝完成後 創建mongodb數據存放文件夾:D盤或其他盤下 創建data文件夾 ,dat
原创 linux上安裝redis
$ wget http://download.redis.io/releases/redis-3.0.4.tar.gz//下載 $ tar xzf redis-2.8.17.tar.gz//解壓 $ cd redis-2.8.17//
原创 mybatis插件和pagehelper
實現Interceptor接口: public Object plugin(Object target) { System.out.println("first Intercept.....plugin"+target);
原创 mybatis 增刪改查
mapper:<mapper namespace="com.uban.mybatis.dao.EmployeeMapper"> <!-- namespace:名稱空間;指定爲接口的全類名 id:唯一標識 resultType:返回值類型
原创 redis 消息訂閱 發佈
訂閱 c1 c2 c3 消息: subscribe c1 c2 c3 發佈消息: publish c2 hello-redis 會收到消息: 點贊 收藏 分享 文章舉報
原创 mybatis 關聯查詢
<resultMap type="com.uban.mybatis.bean.Employee" id="MyDifEmp"> <id column="id" property="id"/> <result column="n
原创 sql語句優化
正常sql語句順序:select-from- join on- where-group by-having-order by -limitjoin語句:inner join 取公共有部分 left join 取左表的獨有和兩表的共有 r
原创 SSM整合
web.xml配置:<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
原创 mysql Explain
explain + sql語句:得到表單:一,id在表單中,如果id相同從上往下順序執行,id不同 ,id值越大,優先級越高,越先執行二,select_type(1) SIMPLE(簡單SELECT,不使用UNION或子查詢等)(2) P
原创 mybatis逆向工程
通過genrator實現,官網爲:http://www.mybatis.org/generator/configreference/xmlconfig.html配置generator.xml:<?xml version="1.0" enc
原创 mybatis 動態sql
if: <select id="getEmpsByConditionIf" resultType="com.uban.mybatis.bean.Employee"> select * from employee where