Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the high-end technologies of Java

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "what are the high-end technologies of Java". In daily operation, I believe many people have doubts about the high-end technology of Java. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what are the high-end technologies of Java?" Next, please follow the editor to study!

Data types commonly used in Redis

The five commonly used data types of Redis are: String, Hash, List, Set and Sorted set

Usage scenarios of Redis

1.Counting (count)

two。 Top list that shows the latest, hottest, highest click rate, highest activity, and so on

3. The recent access history of users is also a good application scenario for redis list.

4. Write and consume queues through list's lpop and lpush interfaces

5.Redis 's Lua extension actually brings more application scenarios to Redis. You can write several command combinations as a small non-blocking transaction or update logic.

The master-slave data synchronization function provided by 6.Redis is actually a powerful function extension to cache.

Summary

So many applications are inseparable from all the features of Redis.

Unveil the mystery of Redis

Redis is an open source (KEY-VALUE key-value pair), in-memory data structure server that can be used as a database, cache and message queue agent. Using single-process and single-thread model, it has strong concurrency ability and is the mainstream distributed cache tool in the current Internet architecture.

Design of Redis High performance caching Architecture

1. Architecture design

Because redis is a single point, it needs to be used in the project and must be distributed on its own. The basic architecture diagram is as follows:

two。 Distributed implementation

The consistent hash of key is used to realize the distribution of key corresponding redis nodes.

Implementation of consistent hash:

Hash value calculation: by supporting MD5 and MurmurHash calculation methods, the default is MurmurHash, efficient hash calculation.

The realization of consistency: simulate the ring structure through the TreeMap of java to achieve uniform distribution.

The choice of 3.client

The modification of jedis is mainly the modification of partition module, which supports partition according to BufferKey, initializes different ShardInfo according to different redis node information, and modifies the underlying implementation of JedisPool, so that the connection pool pool supports following the construction method of key,value, creating different jedis connection clients according to different ShardInfos, achieving the effect of partition and providing layer calls.

4. Description of the module

Dirty data processing module, processing failed cache operations.

Shielding the monitoring module, for the abnormal monitoring of jedis operation, when an anomaly occurs in a node, it can control the removal of redis nodes and other operations.

The whole distributed module removes abnormal redis nodes through hornetq. The addition of new nodes can also be realized by the reload method. (this module can also be easily implemented for new nodes)

At this point, the study of "what are the high-end technologies of Java" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report