Leveraging Message Queues in Distributed Systems: A Comprehensive Technical Analysis

This article presents an examination of message queues, which are extensively utilized in distributed systems. As scenarios requiring their implementation in production environments are anticipated to increase, I have compiled considerations regarding when to contemplate message queue adoption and which technological implementations to employ among various alternatives. Fundamental Concepts A message queue is an asynchronous communication component that guarantees at-least-once delivery of messages, characterized by durability (the property that stored messages are safely retained until retrieval). ...

February 12, 2023 · 1053 words · Mihyang Gu

Functional Programming Concepts: A Comprehensive Book Review and Analysis of Core Principles

Grokking Simplicity: Taming Complex Software with Functional Thinking I have completed the first reading of “Grokking Simplicity” by Eric Normand, an extensive 564-page volume. This journey would have been considerably more challenging without the collaborative study group participants. This text demonstrates exceptional pedagogical quality. Authored specifically for individuals encountering functional programming concepts for the first time, it facilitates accessible learning through interspersed practice problems, chapter conclusions, and recapitulation in subsequent chapters. Our study group collaboratively solved practice problems during sessions and engaged in discussions, which significantly enhanced comprehension. ...

October 30, 2022 · 1222 words · Mihyang Gu

Designing Data-Intensive Applications: Chapter 1 Summary

Since November 2021, I have been studying Martin Kleppmann’s ‘Designing Data-Intensive Applications’ through a study group. This remarkably compact yet profound treatise contains substantial undigested material. While the study group approaches conclusion, I shall revisit particularly significant chapters through review-oriented summarization. Preface Forces Driving Database and Distributed System Development Handling enormous data quantities and traffic volumes → necessitated novel tool creation Enterprises require agility and rapid market adaptation Free open-source software proliferation CPU clock speed growth stagnation, multicore processors standardization, network acceleration → continuous parallelization expansion IaaS platforms such as AWS enable distributed system development for modest teams High availability demands for services Data-Intensive Applications Applications wherein data quantity, complexity, and transformation velocity constitute principal challenges. ...

January 2, 2022 · 977 words · Mihyang Gu

Spring Security: Login Failure Handling After N Attempts - A Journey of Troubleshooting

Recently, I have undertaken Spring Security authentication logic implementation in production environments for the first time. Fundamental functionalities such as login, registration, and authorization proved relatively straightforward owing to abundant tutorials and documentation. However, implementing seemingly trivial auxiliary requirements presented greater challenges. Among these, the troubleshooting process culminating in error handling for multiple consecutive incorrect password entries merits documentation. Initially, I attempted to utilize the AuthenticationFailureHandler interface implementation created for REST API development. ...

December 19, 2021 · 571 words · Mihyang Gu

Binary-to-Text Encoding: Base64, Base32, Base16, Base62, and Base58

In the course of web development, one frequently encounters encoding schemes such as Base64. Until recently, I had merely conceptualized it as a standard for encoding binary data, but upon investigation, the subject proves remarkably intriguing. This exposition examines the fundamental nature of character encoding, the nomenclature conventions for base-N encoding systems, and the distinguishing characteristics among various standards including Base64, Base62, Base32, and Base16. Character Encoding Encoding constitutes the transformation of human-comprehensible data such as textual characters and visual representations into computational signals (sequences of 0 and 1). Character encoding specifically addresses the conversion of textual data into computational signals Representative character encoding methodologies: ASCII (American Standard Code for Information Interchange) ...

December 5, 2021 · 774 words · Mihyang Gu

Generic Type Variance: Invariance, Covariance, and Contravariance

While working with Spring Batch, I encountered ItemWriter’s method void write(List<? extends T> var1) and pondered the rationale for such generic type specification. I have finally undertaken comprehensive investigation. Contravariance concepts proved conceptually challenging, requiring several hours to achieve comprehension. However, upon understanding, the underlying principles appear remarkably straightforward. This exposition attempts maximal clarity. Generic Terminology Initially, I had forgotten even the appropriate search terminology, necessitating terminological review. These terms follow Effective Java conventions. ...

November 7, 2021 · 796 words · Mihyang Gu

Java Interface vs Abstract Class: When to Use What

While “the distinction between interfaces and abstract classes” constitutes a common inquiry, investigation beyond superficial differences reveals remarkably diverse perspectives. Java 8’s introduction of default methods in interfaces substantially diminished the distinctions between the two constructs. This exposition examines in detail when each proves most appropriate. Fundamental Characteristics Let us first examine the basic characteristics. Interface May contain constants (static final) and abstract methods 1 2 3 4 interface Barkable { public static final int BLABLA_CONSTANT = 1; public abstract void bark(); } Java 8 introduced default methods (permitting complete implementation) ...

October 24, 2021 · 890 words · Mihyang Gu

Real MySQL Chapter 6: Execution Plan Analysis Summary

This exposition examines execution plans and index utilization across diverse scenarios in comprehensive detail. 6.1. Overview Execution Plan Definition The optimizer formulates optimal execution strategies by consulting statistical information regarding data distribution across tables to devise optimal execution plans for query execution. Query Execution Phases Parse SQL statements into MySQL server-comprehensible components (SQL parsing) Examine parse tree to determine table reading sequence and index selection (optimization and execution plan formulation by optimizer) Retrieve data from storage engine according to selected sequence and indices Optimizer Categories Most RDBMS systems, including MySQL, employ cost-based optimizers Generate multiple feasible approaches for query processing, calculating costs for each execution plan utilizing cost information for unit operations and predicted statistical data for target tables Rarely employed rule-based optimization exists (establishes execution plans according to optimizer’s built-in priorities. Excludes statistical information such as record counts and column value distributions) Statistical Information Approximate record counts, unique value quantities in indices, et cetera Statistical information proves significantly inaccurate for small record counts. Occasionally necessitates forced renewal via analyze command analyze command: Updates index key value distribution (selectivity) Statistical information collection reads only 8 randomly selected index pages or quantity specified by innodb_stats_sample_pages parameter 6.2. Execution Plan Analysis Update, insert, delete statements lack execution plan verification methods. Create select statements with identical where clauses for verification Execution Plan Column Descriptions id column: Each select statement receives distinct id select_type column SIMPLE: Simple select without subqueries, et cetera PRIMARY: Outermost query in statements containing unions or subqueries UNION, DEPENDENT UNION, UNION RESULT SUBQUERY: Subqueries used outside from clause DEPENDENT SUBQUERY: Subqueries utilizing columns defined in outer select. Outer query executes first → subquery execution. Performance degradation DERIVED: Subqueries used in from clause UNCACHEABLE SUBQUERY, UNCACHEABLE UNION table column: Execution plans display per table rather than per unit select query <derived> or <union> within angle brackets indicate temporary tables Identical ids: Upper lines constitute driving tables. Driving tables are read first for driven table joining type column: Indicates record reading methodology for each table const: Unique index scan. Query processing returning precisely one record utilizing PK or unique key columns in where clause eq_ref: For join queries. First-read table column values equal-compared with next table’s PK or unique key ref: Equal condition searching regardless of joins or constraints range: Index range scan! Index searched with ranges rather than single values index_merge: Multiple index utilization index: Index full scan (reads entire index) ALL: Full table scan - most inefficient key column: Final selected index displayed rows column: Shows approximate record quantities in target tables extra column: Performance-related statement displays 6.3. MySQL’s Principal Processing Methodologies 6.3.1. Full Table Scan Conditions include: extremely small table record counts, absence of index-utilizable conditions in where/on clauses, excessive matching records for range scans ...

September 12, 2021 · 692 words · Mihyang Gu

Understanding Elasticsearch Index Internals

Why refresh is necessary for search visibility

August 15, 2021 · 585 words · Mihyang Gu

Toby's Spring Chapter 7: Application of Core Spring Technologies

This chapter applies Spring’s three core technologies—IoC/DI, service abstraction, and AOP—to application development for creating novel functionality, thereby examining Spring’s development philosophy, pursued values, and requirements for Spring users. 7.1 Separating SQL and DAO Final UserDao improvement: Extracting SQL from DAO Runtime modifications to database tables, field names, or SQL statements necessitate DAO recompilation, proving impractical SQL Separation Methodologies XML configuration-based separation: Define SQL as XML property values for DAO injection SQL provision service: Create independent functionality providing SQL for DAO usage The second approach proves superior, enabling SQL storage in various formats beyond Spring configuration files and facilitating runtime modifications. ...

March 7, 2021 · 448 words · Mihyang Gu