doljae's Blog

website·Indexed 30 days ago

https://doljae.github.io/

A technical blog featuring LeetCode problem solutions (including Dynamic Programming, DFS, and sliding window techniques), shell command explanations, and reviews of technical books on platform engineering, Java, and software development.

Tokens
124K
Snippets
418
Records
693
Agent score
75%

What's inside doljae

  1. Introduction to MyBatis for Java-SQL Mapping

    MyBatis is a framework that provides automatic mapping between Java objects and SQL statements. It allows SQL to be separated into distinct files, enabling a separation of concerns where DBAs can tune SQL without requiring Java code changes or recompilation. It offers a lower learning curve compared to JPA and reduces the boilerplate code associated with JDBC, allowing developers to focus on domain and VO (Value Object) objects.
  2. Understand basic computer networking terminology

    Key networking concepts include:

    • Internet: A global network connecting various smaller networks.
    • Packet: Small fragments of data used for transmission between computers; larger data is split into multiple packets.
    • Bit: The smallest unit of information; 8 bits equal 1 byte.
    • LAN (Local Area Network): A network limited to a building or specific local area. It is faster and has lower error rates than WAN.
    • WAN (Wide Area Network): A network built using services provided by an Internet Service Provider (ISP).
    • DMZ (Demilitarized Zone): A network segment exposed to the outside world, typically hosting public-facing servers such as Web, DNS, and Mail servers.
  3. Configure server redundancy for zero-downtime recovery

    To achieve zero-downtime recovery in a Master-Slave architecture, a minimum of three slave servers is recommended in addition to the master. In a Master + 1 Slave setup, if the slave fails, the service remains active, but recovering that slave requires stopping the remaining slave to copy data, which causes service downtime. With a Master + 3 Slaves setup, a failed slave can be recovered by copying data from other active slaves without interrupting the service.
  4. Learn Kotlin basics using Kotlin Koans

    Kotlin Koans is the official tutorial provided by JetBrains to teach the basic syntax and fundamental knowledge of the Kotlin language. It is a task-based learning experience where users are given problems to solve, accompanied by links to the official documentation to help meet the requirements.
  5. Understand the execution flow of functions

    When a program calls a function, it follows a specific execution sequence:

    1. The program proceeds until it encounters a function call.
    2. It jumps to the memory location where the function is stored.
    3. It executes the code at that memory location.
    4. It returns to the original calling address.

    To manage this, computers use a dedicated memory area (registers) to store the return address. A stack is utilized to store these addresses, ensuring that if a function calls another function (nested calls), each function can return to its correct previous location.

  6. Considerations for migrating to Reactive Programming (WebFlux)

    When considering a transition from a synchronous web server to Reactive Programming (such as Spring WebFlux), evaluate if the current traffic levels justify the complexity. Transitioning small modules to an asynchronous concept can be challenging due to strong coupling with blocking dependencies and the need to rewrite integration tests to support non-blocking flows.
  7. Understand Virtualization and its role in resource utilization

    Virtualization is the act of grouping physical resources (CPU, Memory, Disk I/O, Network I/O) into logical forms. It is primarily used to solve the problem of low resource utilization. In a non-virtualized environment, separate physical servers for different services (e.g., a mail server and a backup server) often lead to inefficiency because services typically have different peak usage times, leaving some hardware idle while others are stressed. Virtualization allows multiple independent services, each with its own Guest OS, to run on a single set of hardware, maximizing resource efficiency.
  8. Install Docker Desktop for Apple Silicon

    Install Docker Desktop for Mac using the official installer. After installation, verify that the Docker architecture is set to 'Apple' (not 'Intel') to ensure the M1-native version is running.
    # Refer to official documentation for Apple Silicon installation
    # https://docs.docker.com/docker-for-mac/apple-silicon/
  9. Distinguish between Frameworks and Libraries

    The primary difference between a framework and a library is the 'inversion of control' regarding the code flow. In a library, the developer maintains control of the flow. In a framework, the framework controls the flow and manages the instantiation of classes based on developer configurations (such as XML or annotations). Frameworks provide a standardized infrastructure to handle non-functional requirements (performance, security, scalability) so developers can focus on business logic.
  10. Implement region-based sharding for used-goods search performance

    To prevent search requests in one specific region from impacting the performance of other regions, Daangn moved from a Hot/Cold architecture to a region-based sharding strategy.

    Key implementation details:

    1. Clustering: Used the Weighted K-Means algorithm to cluster adjacent regions based on document count.
    2. Sharding Logic: Implemented a custom sharding algorithm where a specific hierarchy of regions is assigned to a specific shard.
    3. Routing: A sharding server maintains a mapping table in memory to route search requests only to the shards containing the relevant regional documents.

    Results: Over 50% improvement in response time, 53% reduction in cloud costs, and reduced CPU usage variance across nodes.

  11. Understand Redis memory-based storage performance

    Redis achieves high performance for data read and modification requests by storing data in memory rather than on disk. This eliminates the slowest part of the data retrieval process—disk I/O—and avoids the overhead associated with moving data between disk, memory, and network buffers, as well as the resulting user and kernel thread context switching. While Redis provides persistence options via AOF (Append Only File) and RDB (Snapshot) to save data to disk, its primary performance advantage stems from being memory-based.
  12. Understand Cooperative vs Preemptive Multitasking

    Concurrency involves overlapping multiple processes on a time axis. There are two primary multitasking models:

    1. Cooperative Multitasking: A process voluntarily yields control to another process upon completion of its task. This relies on an ideal scenario where all processes yield at optimal intervals; otherwise, 'starvation' occurs. Examples include Windows 3.1 and Mac OS 9.
    2. Preemptive Multitasking: A separate 'scheduler' forcibly interrupts the currently running process at regular intervals to allow other programs to execute. This is the standard for modern operating systems like Windows 95+, Mac OS X, UNIX, and Linux.