1. The difference between RabbitMQ and RPC? RabbitMQ: message queue, asynchronous, low-level Erlang implementation RPC: remote call, synchronous, low-level socket implementation
  2. How does MQ ensure that messages are not processed repeatedly by multiple consumers, and that messages are consistent and sequential? Consistency: Make each message carry a globally unique ID to ensure the idempotency of the message. The specific consumption process is as follows: (1) After obtaining the message, the consumer first queries whether the message exists in Redis/DB according to its ID. (2) If it does not exist, it will consume normally. After consumption, redis/db will be written. Sequential: (1) single-thread mode to consume: split multiple queues, each queue a consumer (2) multi-thread mode to consume: a queue for a consumer, using memory queue, using multi-thread
  3. Commonly used Redis client, respective advantages? Jedis: Java implementation client of Redis, which provides comprehensive Redis command support. Redisson: An event-driven communication layer based on the Netty framework that implements distributed and extensible Java data structures. You can manipulate a single Redisson connection to accomplish various operations. Oracle: an event-driven communication layer based on the Netty framework, an advanced Redis client for thread-safe synchronization, asynchronous and response use, supporting clustering, Sentinel, pipes and encoders. You can manipulate a single Lettuce connection to perform various operations (asynchronous thread safety)
  4. Redis persistence mechanism, sentinel mechanism, primary node election process, cache expiration mechanism? Persistence mechanism :(1) RDB snapshot; (2) AOF log sentry mechanism: cache expiration mechanism: (1) (active) periodic deletion; (2) (passive) inert delete memory elimination mechanism: (1) volatile-lru -> Delete the least used cache from the cache with expire set, and save the new cache. Based on the access time (recommended) (3) the volatile – lfu – > set up the expire date of the cache, the removal of the least recently used data, based on the access time (4) allkeys lfu – > remove the least frequently used data, Volatile -random -> Purge the least frequently used data from the cache with expire set, Allkeys-random -> Randomly delete some caches based on number of accesses (7) volatile- TTL -> delete caches based on the order of expire time in those caches (8) Noeviction -> Old caches will never expire, New cache cannot be set, error returned

Note: LRU(Least Recently Used) : Removes the Least Recently Used data based on the access time. LFU(Least Frequently Used): Excludes the Least Frequently Used data based on the number of accesses.

  1. Slow SQL optimization measures?
  2. SpringMVC execution flow? What are the core classes?

Core classes:

  1. The execution process of Mybatis? What are the black core classes?
  2. What are the design patterns?
  3. What do you know about class loaders?
  4. Encounter OOM scene, is how to check? What are the common Linux commands?
  5. What are the JVM tuning parameters?
  6. What are the Postgres performance tuning parameters?
  7. What are the common Java performance analysis commands? What performance analysis tools are available?