当前位置:网站首页>Linux server development, redis protocol and asynchronous mode
Linux server development, redis protocol and asynchronous mode
2022-07-07 07:54:00 【Tuen Mun pheasant calls me chicken】
Recommend a free open course of zero sound College , Personally, I think the teacher spoke well , Share with you :Linux,Nginx,ZeroMQ,MySQL,Redis,fastdfs,MongoDB,ZK, Streaming media ,CDN,P2P,K8S,Docker,TCP/IP, coroutines ,DPDK Etc , Learn now
1.redis The network layer of
single reactor Model 

2.redis Of pipeline
redis It's a request response .pipeline Is a client behavior , It can send multiple commands at once , Back together , At least one round-trip time is saved .
lua Multiple statements can be written in a script , And you can have your own logic ,lua The form ability of is relatively strong and atomic . because lua A script is just a command ,redis A single thread , So nature has atomicity .
client script load xxx.lua Send to server , Generate 40 Bit string as a flag script , Reduce network transmission
- A: When you reach a certain state, you can return to the original state .redis It's not atomic , Rollback is not supported .
- C: Constraints are to remain intact ,redis There is no consistency in the traditional sense , For example, add money and reduce money , There are successes and failures .
- I: Single thread execution , All have isolation .
- D: Four persistence strategies .redis It's persistent .
3.redis The business of multi exec lua
adopt MULTI and EXEC The command defines the scope of the transaction . adopt wacth Command lock key, If key Automatically cancel the transaction when changes occur . Usually use lua Scripts handle transactions . It's not transactional , Atomicity , The main goal is to reduce the time of network transmission .
4.redis pub/sub
5. Asynchronous connection
skynet Adopt asynchronous connection .
Four aspects to be realized in the future
- Single threaded reactor
- Multithreading reactor, One in charge listen,8 Threads are responsible for operating the network IO
- Ctrip eliminates callback ,go Language understanding is more profound
- Implement a third-party agreement ,redis,MySql,etcd
边栏推荐
- buuctf misc USB
- Visualization Document Feb 12 16:42
- 2022-07-06:以下go语言代码是否会panic?A:会;B:不会。 package main import “C“ func main() { var ch chan struct
- C语言通信行程卡后台系统
- Ansible
- 【经验分享】如何为visio扩展云服务图标
- [SUCTF 2019]Game
- 242. Bipartite graph determination
- pytest+allure+jenkins安装问题:pytest: error: unrecognized arguments: --alluredir
- Qt学习27 应用程序中的主窗口
猜你喜欢

2022 recurrent training question bank and answers of refrigeration and air conditioning equipment operation
![[webrtc] M98 screen and window acquisition](/img/b1/1ca13b6d3fdbf18ff5205ed5584eef.png)
[webrtc] M98 screen and window acquisition

Ansible

这5个摸鱼神器太火了!程序员:知道了快删!

Qt学习28 主窗口中的工具栏

2022制冷与空调设备运行操作复训题库及答案

《动手学深度学习》(四) -- 卷积神经网络 CNN

自定义类加载器加载网络Class

2022年全国最新消防设施操作员(初级消防设施操作员)模拟题及答案

Jenkins remote build project timeout problem
随机推荐
Kbu1510-asemi power supply special 15A rectifier bridge kbu1510
Common method signatures and meanings of Iterable, collection and list
padavan手动安装php
Cnopendata geographical distribution data of religious places in China
[SUCTF 2019]Game
【斯坦福计网CS144项目】Lab4: TCPConnection
【斯坦福计网CS144项目】Lab3: TCPSender
mysql多列索引(组合索引)特点和使用场景
IO stream file
2022制冷与空调设备运行操作复训题库及答案
leanote私有云笔记搭建
Regular e-commerce problems part1
Most elements
Operation suggestions for today's spot Silver
IPv4 exercises
微信小程序基本组件使用介绍
3D reconstruction - stereo correction
[experience sharing] how to expand the cloud service icon for Visio
通信设备商,到底有哪些岗位?
CentOS7下安装PostgreSQL11数据库