hhxgg Knowledge Base
website·Indexed 30 days ago
https://www.hhxgg.cnA comprehensive collection of full-stack development and DevOps learning notes. It covers Java ecosystem components including Spring, Spring Boot, Spring MVC, Spring Security, MyBatis, and JVM; database management with MySQL, Oracle, and Redis; frontend technologies such as Vue, JavaScript, and HTML; and infrastructure tools like Docker, Linux, and Git.
What's inside hhxgg
- Spring is a lightweight framework providing Inversion of Control (IoC) and Aspect-Oriented Programming (AOP) containers. It is designed to reduce the complexity of enterprise application development by managing Java Beans. It is non-invasive, meaning it does not require changes to existing code to be introduced, and supports transaction management and framework integration.
Overview of Spring Cloud and Alibaba Microservice Components
Spring Cloud provides a set of tools for building distributed systems. Common component stacks include the original Netflix-based stack and the modern Alibaba-based stack.Netflix Stack: 1. Eureka: Service Registration & Discovery 2. Ribbon: Load Balancing 3. Feign: Declarative Service Call 4. Hystrix: Circuit Breaking & Degradation 5. Zuul: API Gateway Alibaba Stack: 1. Nacos: Service Registration & Discovery / Config Center 2. Ribbon: Load Balancing 3. Feign: Declarative Service Call 4. Sentinel: Circuit Breaking & Degradation 5. Gateway: API GatewayInspect Docker container processes and metadata
Usedocker topto view the running processes inside a container anddocker inspectto retrieve detailed low-level information (metadata) about a container or image in JSON format.# View process information docker top <container_id> # View detailed container/image metadata docker inspect <container_id>Understand the Spring Ecosystem (Boot and Cloud)
Modern Java development extends the core Spring framework with:
- Spring Boot: A scaffolding tool that simplifies configuration and allows developers to quickly start and run standalone microservices.
- Spring Cloud: Built on top of Spring Boot to provide tools for coordinating multiple services within a microservices architecture.
- Spring Cloud Data Flow: Used to connect and manage microservices.
Understand Multi-Version Concurrency Control (MVCC)
MVCC allows for 'Consistent Reads' (Snapshot Reads), enabling a transaction to see the value of data as it existed before it was changed by another transaction. It relies on three core components:
- Hidden Fields: System columns in each row.
- Undo Log: Stores previous versions of the data.
- Read View: Determines which version of the data is visible to the current transaction.
Understand Spring Boot Auto-Configuration and Starters
Spring Boot uses 'Starters' to simplify dependency management by grouping all necessary dependencies for a specific scenario (e.g.,spring-boot-starter-webfor web environments). Auto-configuration automatically applies default settings to the application, reducing manual XML or Java configuration. The system identifies configuration classes by scanning theMETA-INF/spring.factoriesfile.JVM Memory Architecture Overview
The JVM divides memory into several distinct areas:
- PC Register: A thread-private pointer to the current bytecode instruction in the method area.
- JVM Stack: Thread-private memory managing method execution, local variables, and method indices. It follows a First-In-First-Out (FIFO) structure. Excessive mutual method calls can lead to a
StackOverflowError. - Method Area: Shared across threads. Stores class structures, constructors, interface definitions, static variables, and the runtime constant pool.
- Heap: The primary area for object instances. It is shared across threads and is the main target for Garbage Collection (GC).
Understand MySQL Logical Architecture
The MySQL server (
mysqld) consists of several layers:- Connection Pool: Manages TCP connections and thread authentication.
- Parser: Performs lexical and syntactic analysis to generate a syntax tree.
- Optimizer: Generates execution plans based on cost calculations.
- Query Cache: (Removed in 8.0) Stores key-value pairs of queries; low hit rate.
- Storage Engine: Handles physical data extraction and storage (e.g., InnoDB, MyISAM).
Understand the Java Memory Model (JMM)
The JMM is an abstract specification defining how threads interact with memory. It defines the relationship between the Main Memory (shared variables) and Thread Working Memory (private local copies).
- Visibility:
volatileandsynchronizedare used to ensure changes to shared variables are visible across threads. - Happens-Before Rule: A guarantee that one operation is visible to another and that the first operation occurs before the second in the execution sequence.
- Visibility:
Monitor Microservices with Apache SkyWalking
SkyWalking is an open-source APM (Application Performance Monitor) used for distributed tracing. It monitors interfaces, services, and physical instances to identify bottlenecks during stress testing and provides alerting rules via SMS and email for production bugs.Understand JVM ClassLoader and the Parent Delegation Model
The ClassLoader is responsible for loading
.classfiles through a lifecycle of loading, verification, preparation, resolution, initialization, use, and destruction. The JVM utilizes a hierarchy of loaders: the Bootstrap ClassLoader (root), Extension ClassLoader, and Application ClassLoader.The Parent Delegation Model ensures security by delegating loading requests upwards: Application -> Extension -> Bootstrap. If a parent loader can load the class, it does so; otherwise, it notifies the child loader to attempt loading.
Understand Docker core components
Docker operates on a Client-Server architecture where the Docker daemon (server) executes instructions sent by the Docker client via a socket. The system consists of three primary components:
- Image: A read-only template used to create container services (e.g., a Tomcat image).
- Container: An isolated, runnable instance of an image that acts as a lightweight Linux system.
- Repository: A storage location for images (e.g., Docker Hub or Alibaba Cloud mirror).