Update Rocket.md

pull/9/head
hmao 5 years ago committed by GitHub
parent 239613afa1
commit f7b0cddc08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -984,6 +984,13 @@ public class Test {
常见的限流算法有计数器、漏桶和令牌桶算法。漏桶算法在分布式环境中消息中间件或者Redis都是可选的方案。发放令牌的频率增加可以提升整体数据处理的速度而通过每次获取令牌的个数增加或者放慢令牌的发放速度和降低整体数据处理速度。而漏桶不行因为它的流出速率是固定的程序处理速度也是固定的。 常见的限流算法有计数器、漏桶和令牌桶算法。漏桶算法在分布式环境中消息中间件或者Redis都是可选的方案。发放令牌的频率增加可以提升整体数据处理的速度而通过每次获取令牌的个数增加或者放慢令牌的发放速度和降低整体数据处理速度。而漏桶不行因为它的流出速率是固定的程序处理速度也是固定的。
### HTTPS和HTTP的区别主要如下
1、https协议需要到ca申请证书一般免费证书较少因而需要一定费用。
2、http是超文本传输协议信息是明文传输 https则是具有安全性的ssl加密传输协议
3、http和https使用的是完全不同的连接方式用的端口也不一样前者是80后者是443
### 秒杀并发情况下库存为负数问题 ### 秒杀并发情况下库存为负数问题
1. for update显示加锁 1. for update显示加锁
@ -996,4 +1003,4 @@ select quantity from products WHERE id=3 for update;
``` ```
quantity = select quantity from products WHERE id=3; quantity = select quantity from products WHERE id=3;
update products set quantity = ($quantity-1) WHERE id=3 and queantity = $quantity; update products set quantity = ($quantity-1) WHERE id=3 and queantity = $quantity;
```

Loading…
Cancel
Save