lizhifuabc Technical Documentation

website·Indexed 30 days ago

https://lizhifuabc.github.io/

A comprehensive collection of technical notes and guides covering Java core concepts (HashMap, ArrayList, Thread Pools, SPI), Spring Framework (AOP, Bean lifecycle, Transactions, Events), MyBatis (Dynamic SQL, TypeHandlers, Interceptors), RabbitMQ, Git workflows, and general software design patterns.

Tokens
61.8K
Snippets
165
Records
411
Agent score
67%

What's inside lizhifuabc Knowledge Base

  1. Overview of Java CompletableFuture

    CompletableFuture is a class in the java.util.concurrent package introduced in Java 8 to handle asynchronous programming and concurrent operations. It provides a framework for managing asynchronous tasks, combining multiple tasks (sequentially or in parallel), handling exceptions, implementing callbacks, and managing timeouts through a fluent chain-calling API.
  2. Overview of JVM Architecture Components

    The JVM architecture consists of three primary components that manage the execution of Java programs:

    1. Class Loader: Responsible for loading bytecode files and converting them into runtime class objects.
    2. Runtime Data Area: The memory regions used to store program data and execution state (e.g., Method Area, Heap, Stacks).
    3. Execution Engine: Interprets or compiles bytecode into machine code for execution.
  3. Overview of Apache Maven for Java Project Management

    Maven is an open-source project management and build automation tool for Java applications. It provides a standardized project structure and a defined build lifecycle to simplify the process of compiling, testing, packaging, and deploying software. Key advantages include automated builds, centralized dependency management, a consistent project structure for team collaboration, and an extensible plugin ecosystem.
  4. Overview of Resilience4j Fault Tolerance Modules

    Resilience4j is a lightweight fault tolerance library designed for Java 8 and functional programming, serving as an alternative to Netflix Hystrix. It provides several modules to handle distributed system failures:
  5. Overview of MySQL Performance Schema and Audit Logging

    • Performance Schema: Provides detailed internal metrics on execution plans, wait events, and resource usage for performance analysis and tuning.
    • Audit Log: Records authentication and authorization events. MySQL typically requires third-party tools or plugins for this functionality as it is not built-in by default.
  6. Implement OAuth2 Client and Resource Server architectures

    Depending on the project architecture, the OAuth2 client and resource server dependencies should be configured as follows:

    1. Monolithic Project: Add both resource server and client dependencies. The client handles the login process via the authorization server, and the resource server is configured to parse the resulting tokens.
    2. Gateway-based Project (Two Approaches):
      • Token Relay: Add client dependencies to the Gateway to check user authentication. Microservices behind the gateway add resource server dependencies to parse the access_token passed via token relay. Each microservice then implements its own authorization checks.
      • Centralized Gateway Security: Integrate both client and resource server dependencies directly into the Gateway. The Gateway handles all authentication and authorization. Microservices do not need security logic but must be configured to only accept traffic from the Gateway's IP to prevent unauthorized direct access.
  7. Understand the core principles of Thread Pools

    A thread pool manages the number of active threads and handles task distribution to optimize resource usage. Its core mechanism involves:

    1. Task Queuing: Tasks are placed into a queue for processing.
    2. Thread Management: Threads are created to execute tasks from the queue. If the number of threads reaches the defined maximum, additional tasks must wait in the queue until existing threads complete their current work.

    Key Benefits:

    • Thread Reuse: Reduces the overhead of frequently creating and destroying threads.
    • Concurrency Control: Limits the maximum number of concurrent threads to prevent system exhaustion.
    • Lifecycle Management: Provides a structured way to manage thread existence and execution.
  8. Scale SaaS architecture using Application-to-Database mapping

    In large-scale SaaS environments where both application servers (m) and database servers (n) are scaling horizontally, a 'full mesh' connection (m x n) creates excessive overhead and connection limits. To optimize this, avoid making all application servers equal. Instead, map specific groups of application servers to specific database servers. This ensures that each application server group only maintains connections to its corresponding database servers, reducing the total number of active connections and improving system stability.
  9. Understand OAuth 2.0 core concepts and roles

    OAuth 2.0 is an open standard that allows a third-party application to access private resources (e.g., photos, videos, contacts) stored on a website on behalf of a user, without requiring the user to share their credentials (username and password) with the third party.

    There are four primary roles in the OAuth 2.0 flow:

    • Resource Owner: The end-user who grants access to the protected resources.
    • Resource Server: The server hosting the protected resources. It validates the access token provided by the client before returning the requested data.
    • Authorization Server: The server that authenticates the resource owner and issues the Access Token to the client upon successful authorization.
    • Client: The third-party application (or an official app) that requests access to the resource owner's data using the access token.