当前位置:网站首页>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
边栏推荐
- leetcode:105. Constructing binary trees from preorder and inorder traversal sequences
- C语言航班订票系统
- Few-Shot Learning && Meta Learning:小样本学习原理和Siamese网络结构(一)
- leanote私有云笔记搭建
- [OBS] win capture requires winrt
- Hands on deep learning (IV) -- convolutional neural network CNN
- MySQL multi column index (composite index) features and usage scenarios
- Technology cloud report: from robot to Cobot, human-computer integration is creating an era
- [UVM practice] Chapter 1: configuring the UVM environment (taking VCs as an example), run through the examples in the book
- Tongda injection 0day
猜你喜欢

leetcode:105. Constructing binary trees from preorder and inorder traversal sequences

Sign up now | oar hacker marathon phase III, waiting for your challenge

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

2022-07-06:以下go语言代码是否会panic?A:会;B:不会。 package main import “C“ func main() { var ch chan struct
![[Stanford Jiwang cs144 project] lab3: tcpsender](/img/82/5f99296764937e7d119b8ab22828fd.png)
[Stanford Jiwang cs144 project] lab3: tcpsender
![[UTCTF2020]file header](/img/e3/818e2d531a06ab90de189055f634ad.png)
[UTCTF2020]file header

Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)

Ansible

【经验分享】如何为visio扩展云服务图标

【webrtc】m98 screen和window采集
随机推荐
[guess-ctf2019] fake compressed packets
Live online system source code, using valueanimator to achieve view zoom in and out animation effect
[SUCTF 2019]Game
Operation suggestions for today's spot Silver
[2022 actf] Web Topic recurrence
pytest+allure+jenkins環境--填坑完畢
Leanote private cloud note building
微信小程序基本组件使用介绍
面试结束后,被面试官在朋友圈吐槽了......
A bit of knowledge - about Apple Certified MFI
Regular e-commerce problems part1
知识点滴 - 关于苹果认证MFI
Figure out the working principle of gpt3
Numbers that appear only once
[mathematical notes] radian
Pytest+allure+jenkins installation problem: pytest: error: unrecognized arguments: --alluredir
nacos
[webrtc] m98 Screen and Window Collection
Qt学习28 主窗口中的工具栏
[UTCTF2020]file header