Begun Blog by 咖飞
website·Indexed 30 days ago
https://began-zhao.github.io/begun-blog/A technical blog by backend engineer 咖飞 covering Java development, Spring and Spring Boot annotations, Redis persistence, MyBatis, and Docker. The site includes guides on Linux command formats, Bash string operations, GitHub Actions workflows, and distributed systems using ZooKeeper and RocketMQ, as well as computer science basics like the OSI and TCP/IP models.
What's inside Begun Blog
- Spring Cloud is a one-stop solution for microservices system architecture built on top of Spring Boot. It provides a programming model to implement common distributed system patterns, including service discovery/registration, configuration centers, message buses, load balancing, circuit breakers, and data monitoring, helping developers build resilient and reliable applications.
Overview of MySQL Architecture
MySQL is divided into two primary layers: the Server layer and the Storage Engine layer.
- Server Layer: Implements cross-storage engine functionality, including stored procedures, triggers, views, and functions. It contains the general binlog (archive log) module and the following components: Connector, Query Cache (removed in 8.0), Analyzer, Optimizer, and Executor.
- Storage Engine Layer: Responsible for data storage and retrieval using a pluggable architecture. Supported engines include InnoDB (the default since MySQL 5.5), MyISAM, and Memory. InnoDB includes its own specific redo log module.
Overview of CompletableFuture
CompletableFuture is a Java 8 class used for asynchronous programming. It implements both theFutureandCompletionStageinterfaces, combining the ability to track asynchronous tasks with functional programming capabilities for chaining operations.Overview of Java language characteristics
Key features of the Java language include:
- Object-Oriented: Supports encapsulation, inheritance, and polymorphism.
- Platform Independence: Achieved via the JVM.
- Multi-threading: Built-in support for multi-threaded programming.
- Network Programming: Designed from the ground up to simplify network-based applications.
- Hybrid Execution: Combines compilation and interpretation for a balance of speed and portability.
Overview of Java Atomic classes in java.util.concurrent.atomic
Atomic classes provide lock-free, thread-safe operations on single variables. They ensure that an operation is indivisible (atomic) and cannot be interrupted by other threads. The JUC atomic classes are categorized into four types:
- Basic Types:
AtomicInteger,AtomicLong,AtomicBoolean(atomic updates to primitives). - Array Types:
AtomicIntegerArray,AtomicLongArray,AtomicReferenceArray(atomic updates to array elements). - Reference Types:
AtomicReference: Atomic update to an object reference.AtomicStampedReference: Maintains a version number (stamp) alongside the reference to solve the ABA problem.AtomicMarkableReference: Maintains a boolean mark alongside the reference.
- Field Updaters:
AtomicIntegerFieldUpdater,AtomicLongFieldUpdater,AtomicReferenceFieldUpdater(atomic updates to specific volatile fields of an object).
- Basic Types:
Overview of HotSpot JVM Runtime Data Areas
The HotSpot JVM divides its managed memory into several data areas. These are categorized by their accessibility across threads:
Thread-Private Areas (created/destroyed with the thread):
- Program Counter (PC Register)
- JVM Stack
- Native Method Stack
Thread-Shared Areas (shared across all threads):
- Heap
- Method Area
- Direct Memory (Note: Direct memory is not technically part of the runtime data area but is used by the JVM).
Overview of core Spring Cloud components
Spring Cloud provides a suite of tools for building microservices architectures. The core components include:
- Eureka: Service discovery framework
- Ribbon: Client-side (in-process) load balancer
- OpenFeign: Declarative service call mapping/HTTP client
- Hystrix: Service degradation and circuit breaker for fault tolerance
- Zuul: Microservice API gateway
- Config: Centralized configuration management center
- Bus: Message bus for distributing state changes across services
Overview of Java Concurrency Utilities (JUC)
Java provides several synchronization auxiliary classes and interfaces to manage concurrent tasks and shared resources:
Lockinterface: Provides more flexible locking mechanisms thansynchronized(e.g.,ReentrantLock,ReentrantReadWriteLock).Semaphore: A counter-based synchronization tool used to limit the number of threads accessing a shared resource.CountDownLatch: Allows one or more threads to wait until a set of operations being performed in other threads completes.CyclicBarrier: Allows a set of threads to all wait for each other to reach a common barrier point.Phaser: A flexible synchronization barrier that supports multiple phases of execution; all threads in a phase must complete before the next phase begins.Exchanger: Provides a synchronization point where two threads can exchange data.
Overview of Redis capabilities and data types
Redis (Remote Dictionary Server) is an open-source, in-memory data structure store used as a database, cache, and message middleware. It provides atomic operations across a wide variety of data types and supports high availability via Sentinel and Cluster. Key features include built-in replication, Lua scripting, LRU eviction, and various disk persistence levels.Supported Data Types:
- string
- list
- set
- zset (sorted set)
- hash
- bitmap
- hyperloglog
- GeoHash
- streams
Overview of the Unity Desktop Shell
Unity is a desktop shell developed by Canonical that runs on top of the GNOME desktop environment, utilizing GNOME's core applications while providing a unique user interface.
Key Characteristics:
- Features: Includes a left-side launcher and the 'Dash' search tool, which provides both local disk results and online results (e.g., Google Drive, Facebook). It supports hiding the launcher and adjusting menu sensitivity.
- Pros: Clean and intuitive interface; utilizes technologies like the HUD (Heads-Up Display).
- Cons: Poor default customization options and a mediocre notification system.
- Customization: Because built-in settings are limited, users typically use third-party tools like CCSM and the Unity Tweak Tool for deep customization.
Overview of JVM Garbage Collectors
JVM garbage collectors are concrete implementations of memory recovery algorithms. There is no single 'best' collector; the choice depends on the specific application scenario, balancing the trade-off between throughput (CPU efficiency) and pause time (user experience).Overview of Java Class File Structure
Java source code is compiled into bytecode (files with the.classextension), which is a platform-independent binary format designed for the Java Virtual Machine (JVM). This allows Java programs to run on any operating system without recompilation. Other languages like Clojure, Groovy, and Scala also compile to this format to run on the JVM.