Java Architect factory interview deadly ten consecutive questions, can you answer it?
1. What is cache avalanche? How?
Usually, we use cache to buffer the impact on DB. If the cache goes down, all requests will be directly sent to DB, resulting in DB downtime - leading to the downtime of the whole system.
How to solve it?
Two strategies (used simultaneously):
Make cache highly available to prevent cache downtimeUsing ...
Posted by yarin on Wed, 09 Mar 2022 08:08:46 +0100
[redis series] redis learning 7. Details of redis configuration files you don't know
Detailed explanation of Redis configuration file
Company
When redis is started, it will read the configuration file redis conf
1k => 1000 bytes
1kb => 1024 bytes
1m => 1000000 bytes
1mb => 1024*1024 bytes
1g => 1000000000 bytes
1gb => 1024*1024*1024 bytes
Units in redis are not case sensitive. For example, 1GB, 1GB and ...
Posted by marting on Sun, 06 Mar 2022 12:11:18 +0100
Redis cluster usage example
Today, I learned about the use of redis cluster. Here, I will record the problems encountered in the process
1, Environment construction (docker needs to be installed first)
Here, docker will be used to deploy four redis instances (node1-3 as the primary node and node4 as the standby node of 1)
Here, four redis instances are deployed on th ...
Posted by drag0n on Sat, 05 Mar 2022 16:34:21 +0100
[high frequency interview questions from large factories] explain in detail the implementation of LRU cache (the least used cache recently) - C + + version
1 what is LRU cache
LRU (Least Recently Used) algorithm is an elimination strategy. In short, the implementation is as follows: put some elements into a container with fixed capacity for access. Due to the limited capacity of the container, the container should ensure that the elements that have been used recently are always in the contain ...
Posted by lpxxfaintxx on Thu, 03 Mar 2022 04:51:19 +0100
Hand tearing algorithm -- LRU cache elimination strategy, asked so often
As we all know, the size of cache is limited! When the cache is full, it requires a cache elimination strategy to determine which data should be cleaned out. There are three common strategies: First In, First Out (FIFO), Least Frequently Used (LFU) and Least Recently Used (LRU).
Take a look at this LRU design question on LeetCode:
1.Please de ...
Posted by Topper on Wed, 02 Mar 2022 15:59:16 +0100
How rabbimq ensures data security
I Persistence
RabbitMQ supports message persistence, that is, data is written on disk. (1) exchange persistence, specifying durable = > 1 when declaring (2) queue persistence, specifying durable = > 1 when declaring (3) Message persistence, specifying delivery when delivering_ Mode = > 2 (1 is non persistent) Note: if the message is p ...
Posted by kraadde on Wed, 02 Mar 2022 06:26:09 +0100
Http proxy server - Netty version
Basic ideas
First, explain the basic ideas. The following figure shows the location of the proxy server:
From the position of the proxy server, its functions have three points
Receive data from the requesterForward request to target serverForward the data of the target server to the requester
Therefore, when we use Netty to build a proxy s ...
Posted by smonsivaes on Tue, 01 Mar 2022 16:34:52 +0100
Three ways Redis can realize current limiting
In the face of more and more high concurrency scenarios, the display of current limit is particularly important.
Of course, there are many ways to implement current limiting. Redis has very powerful functions. I have practiced three ways with redis, which can be implemented in a relatively simple way. Redis can not only limit current, but also ...
Posted by weiwei on Mon, 28 Feb 2022 11:18:28 +0100
Redis basic data type
Five basic data types of Redis
For redis, all key s are strings.
The basic data structure of Redis we usually talk about is the data type of stored value.
The five common data types in Redis are: String, List, Set, Zset and Hash.
structure type Value stored by structureStructure reading and writing abilityString stringCan be string, float ...
Posted by TheoGB on Sun, 27 Feb 2022 06:00:04 +0100
Springboot-24 advanced feature - cache (JSR107, cache abstraction, Cacheable, redis integration)
Purpose:
Read cache to reduce server pressure and improve performance;Temporary data, such as validity verification code;
1,JSR107
(1) java caching defines five core interfaces
Cache provider: create, configure, obtain, manage and control the cache manager. An application can access multiple cache providers at runtime;chchemanager: create, ...
Posted by timmytock on Sat, 26 Feb 2022 09:53:18 +0100