当前位置:网站首页>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
边栏推荐
猜你喜欢

2022茶艺师(初级)考试题模拟考试题库及在线模拟考试

PHP exports millions of data

有 Docker 谁还在自己本地安装 Mysql ?

2022 recurrent training question bank and answers of refrigeration and air conditioning equipment operation

2022 tea master (intermediate) examination questions and mock examination

Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)
![[mathematical notes] radian](/img/43/2af510adb24fe46fc0033d11d60488.jpg)
[mathematical notes] radian

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

Common method signatures and meanings of Iterable, collection and list

海思芯片(hi3516dv300)uboot镜像生成过程详解
随机推荐
Pytest + allure + Jenkins Environment - - achèvement du remplissage de la fosse
The configuration that needs to be modified when switching between high and low versions of MySQL 5-8 (take aicode as an example here)
Redis technology leak detection and filling (II) - expired deletion strategy
json 数据展平pd.json_normalize
智联+影音,AITO问界M7想干翻的不止理想One
Common method signatures and meanings of Iterable, collection and list
You Li takes you to talk about C language 6 (common keywords)
Problem solving: unable to connect to redis
Visualization Document Feb 12 16:42
【斯坦福计网CS144项目】Lab4: TCPConnection
php导出百万数据
Write CPU yourself -- Chapter 9 -- learning notes
Kbu1510-asemi power supply special 15A rectifier bridge kbu1510
numpy中dot函数使用与解析
SQL优化的魅力!从 30248s 到 0.001s
Use and analysis of dot function in numpy
【斯坦福计网CS144项目】Lab3: TCPSender
Rust Versus Go(哪种是我的首选语言?)
微博发布案例
@component(““)