当前位置:网站首页>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
边栏推荐
- Shell 脚本的替换功能实现
- Linux server development, MySQL process control statement
- 2022焊工(初级)判断题及在线模拟考试
- Rust Versus Go(哪种是我的首选语言?)
- Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)
- Ansible
- The configuration that needs to be modified when switching between high and low versions of MySQL 5-8 (take aicode as an example here)
- @component(““)
- Live online system source code, using valueanimator to achieve view zoom in and out animation effect
- 2022 tea master (intermediate) examination questions and mock examination
猜你喜欢
leetcode:105. Constructing binary trees from preorder and inorder traversal sequences
Idea add class annotation template and method template
为什么要了解现货黄金走势?
Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)
[Stanford Jiwang cs144 project] lab3: tcpsender
misc ez_usb
2022 simulated examination question bank and online simulated examination of tea master (primary) examination questions
2022 welder (elementary) judgment questions and online simulation examination
[UTCTF2020]file header
[experience sharing] how to expand the cloud service icon for Visio
随机推荐
知识点滴 - 关于苹果认证MFI
Tongda injection 0day
Solution: could not find kf5 (missing: coreaddons dbusaddons doctools xmlgui)
Kbu1510-asemi power supply special 15A rectifier bridge kbu1510
快速使用 Jacoco 代码覆盖率统计
Route jump in wechat applet
[Stanford Jiwang cs144 project] lab3: tcpsender
php导出百万数据
【p2p】本地抓包
Info | webrtc M97 update
Ansible
buuctf misc USB
【webrtc】m98 screen和window采集
[webrtc] m98 Screen and Window Collection
[mathematical notes] radian
[UTCTF2020]file header
[Matlab] Simulink 自定义函数中的矩阵乘法工作不正常时可以使用模块库中的矩阵乘法模块代替
leetcode:105. 从前序与中序遍历序列构造二叉树
大视频文件的缓冲播放原理以及实现
[GUET-CTF2019]虚假的压缩包