Yumin Fish Harvest
Author

Yumin Fish Harvest

A deep‑sea salvage fisherman sharing architecture insights, practical tips, and lessons learned.

27
Articles
0
Likes
147
Views
0
Comments
Recent Articles

Latest from Yumin Fish Harvest

27 recent articles
Yumin Fish Harvest
Yumin Fish Harvest
Oct 2, 2026 · Backend Development

Concurrent Write Correctness: Choosing Between Conditional Updates, Pessimistic/Optimistic Locks, and Distributed Locks

This article analyzes four concurrency control patterns — conditional updates, pessimistic locking, optimistic locking with version numbers, and distributed locks — using inventory deduction, order editing, and third-party push examples. It explains when each pattern applies, how to combine them with idempotency, and provides concrete SQL and Redis implementations.

Concurrency ControlRedisconditional update
0 likes · 32 min read
Concurrent Write Correctness: Choosing Between Conditional Updates, Pessimistic/Optimistic Locks, and Distributed Locks
Yumin Fish Harvest
Yumin Fish Harvest
Sep 21, 2026 · Backend Development

Idempotency Design for Write Services: 7 Patterns & Selection Guide

This article details seven idempotency patterns for backend write operations—including unique keys with database constraints, state machines, execution records, naturally idempotent actions, request fingerprinting, client-generated keys, and server-issued tokens—with concrete examples, SQL code, and a selection guide to match each pattern to specific business scenarios like payment callbacks, order cancellations, and duplicate purchases.

backend developmentconditional updatedatabase unique constraint
0 likes · 29 min read
Idempotency Design for Write Services: 7 Patterns & Selection Guide
Yumin Fish Harvest
Yumin Fish Harvest
Aug 29, 2026 · Backend Development

CosId Distributed ID Generation: Snowflake & Segment Modes Explained

This article explores CosId's two ID generation modes—local computation (Snowflake) and segment allocation (SegmentId, SegmentChainId)—with detailed configuration for JDBC, Redis, ZooKeeper, MongoDB, and Proxy backends, plus Spring Boot, MyBatis, and ShardingSphere integration examples.

CosIdJDBCRedis
0 likes · 34 min read
CosId Distributed ID Generation: Snowflake & Segment Modes Explained
Yumin Fish Harvest
Yumin Fish Harvest
Aug 23, 2026 · Backend Development

How to Deploy TSID for Distributed ID Generation: From Local Setup to Multi‑Cluster Kubernetes

This article walks through using the TSID library to generate 64‑bit numeric and 13‑character string IDs, shows a quick‑start Maven example, integrates the creator into Spring Boot as a singleton bean, explains node and nodeCount configuration, and details deployment strategies for fixed servers, a single Kubernetes cluster, and multiple clusters.

JavaKubernetesSpring Boot
0 likes · 16 min read
How to Deploy TSID for Distributed ID Generation: From Local Setup to Multi‑Cluster Kubernetes
Yumin Fish Harvest
Yumin Fish Harvest
Aug 18, 2026 · Backend Development

Distributed Snowflake ID Generation in Java: Hutool and MyBatis-Plus Demo

This article walks through the Snowflake algorithm for distributed ID generation, detailing its timestamp, workerId and sequence fields, handling clock rollback and sequence overflow, and provides a complete Java implementation with integration examples for Hutool and MyBatis‑Plus, including configuration and test code.

JavaMyBatis-PlusSnowflake
0 likes · 28 min read
Distributed Snowflake ID Generation in Java: Hutool and MyBatis-Plus Demo
Yumin Fish Harvest
Yumin Fish Harvest
Aug 17, 2026 · Backend Development

How to Implement Distributed ID Generation with Segment Mode? A Double‑Buffer Issuer in Practice

The article analyses lock contention caused by per‑request ID generation, derives a segment‑based solution that batches IDs using a configurable step, defines a left‑closed/right‑open interval schema in MySQL, and builds a double‑buffer Java issuer with asynchronous pre‑loading, thorough concurrency handling, testing, and configuration guidelines.

ConcurrencyJavadistributed-id
0 likes · 21 min read
How to Implement Distributed ID Generation with Segment Mode? A Double‑Buffer Issuer in Practice
Yumin Fish Harvest
Yumin Fish Harvest
Aug 16, 2026 · Databases

Implementing Continuous Invoice Numbers Using a Transactional Watermark Table

The article explains how to generate strictly sequential invoice numbers required by auditors by using a MySQL InnoDB watermark (water level) table combined with row locking and UPSERT within a single transaction, covering the workflow, concurrency handling, rollback versus void semantics, performance trade‑offs, and applicability limits.

auditmysqlsequential IDs
0 likes · 16 min read
Implementing Continuous Invoice Numbers Using a Transactional Watermark Table
Yumin Fish Harvest
Yumin Fish Harvest
Aug 15, 2026 · Backend Development

Choosing a Decentralized Distributed ID: UUIDv4 vs UUIDv7 vs ULID vs Nano ID

This article examines how traceId, eventId, and shareId differ in requirements and walks through a detailed comparison of UUIDv4, UUIDv7, ULID, and Nano ID—covering generation principles, ordering characteristics, storage impact, Java code examples, and practical guidance for selecting the right scheme.

JavaUUIDdistributed-id
0 likes · 24 min read
Choosing a Decentralized Distributed ID: UUIDv4 vs UUIDv7 vs ULID vs Nano ID
Yumin Fish Harvest
Yumin Fish Harvest
Aug 13, 2026 · Databases

How to Choose Storage for Query Services: Relational DB, Search, OLAP, and Time‑Series Models

The article walks through a systematic method for selecting the right storage technology—relational OLTP, search engine, OLAP, or time‑series—based on query intent, data volume, latency tolerance, and consistency needs, using an e‑commerce “optimal store” scenario to illustrate the decision process and practical trade‑offs.

CDCOLAPread-model
0 likes · 30 min read
How to Choose Storage for Query Services: Relational DB, Search, OLAP, and Time‑Series Models