[Interview question analysis]-20200410Java software development engineer interview question analysis

1. What is cache penetration? How to solve cache penetration?

The so-called cache penetration refers to the fact that there is no row of data in the database, and then there is no corresponding key value in the cache, resulting in always directly accessing the database when requesting this row of data. To solve the cache penetration, you only need to save an empty value to the cache if the specified value is not queried after the database is accessed.

2. What is a cache avalanche? How to solve the cache avalanche?

The so-called cache avalanche refers to multiple cache keys failing at almost the same time. To solve the cache avalanche, you only need to set a different expiration time for each cache, such as calculating the expiration time by the product of a constant and a random number.

3. What is cache breakdown? How to solve cache breakdown?

The so-called cache breakdown refers to a hot spot key failure in a certain period of time, and this time is a period of time with a relatively large amount of concurrency, this time will cause the database pressure to double. To solve the cache breakdown, it can be disabled by adding distributed locks or current limiting when accessing the database.

4. What is a single point of failure?

Single point of failure, which occurs in a distributed system. For example, there are now three servers, one of which is the master server (such as a service gateway), and the other two are slave servers (service providers). If the master server fails at this time, Then the service provided by the service provider cannot be accessed normally. To solve this problem can be achieved through cluster deployment, such as deploying multiple master servers.

5. What is a service fuse?

Service fuse, also known as fuse mechanism. It is a strategy for service link protection. When a service is unavailable, it will trigger a fuse mechanism at its parent caller to quickly return error information and other services. effect.

Published 143 original articles · 75 praises · 30,000+ views

Guess you like

Origin blog.csdn.net/qq_43199016/article/details/105447220