← ClaudeAtlas

cosid-strategy-guidelisted

Choose a CosId ID generation strategy for Java distributed systems. Use when the user compares CosIdGenerator, SnowflakeId, SegmentId, or SegmentChainId, or asks about ID representation, ordering guarantees, clock sensitivity, JavaScript safety, coordination backends, gaps, throughput, or production tradeoffs. Do not use for implementation-only requests after the strategy is already fixed; use cosid-spring-boot or cosid-manual-integration instead.
Ahoo-Wang/skills · ★ 3 · AI & Automation · score 76
Install: claude install-skill Ahoo-Wang/skills
# Choose a CosId Strategy Recommend one strategy from explicit requirements. Do not default to the largest benchmark number. ## Workflow 1. Confirm the target CosId major version. In a CosId checkout, read `gradle.properties`; do not assume the current branch matches the user's application. 2. Collect the required ID type, ordering scope, peak and burst rate, instance count, JavaScript exposure, acceptable gaps, available infrastructure, and outage behavior. 3. Recommend one primary strategy. Add a fallback only when a real constraint creates a close tradeoff. 4. State the operational cost and the exact ordering guarantee. 5. Hand implementation to `$cosid-spring-boot` or `$cosid-manual-integration`. ## Decision Table | Strategy | Output | Ordering | Coordination | Main constraint | |---|---|---|---|---| | `CosIdGenerator` | `String` only | Locally time-ordered; globally affected by clocks | Unique machine ID | Clock-sensitive; `generate()` is unsupported | | `SnowflakeId` | `long` and converted `String` | Locally monotonic; globally trend-ordered | Unique machine ID | Clock-sensitive and bounded by bit allocation | | `DefaultSegmentId` | `long` and converted `String` | Locally monotonic; globally trend-ordered by allocated ranges | `IdSegmentDistributor` at segment rollover | Allocation can stall or fail when the current segment is exhausted | | `SegmentChainId` | `long` and converted `String` | Locally monotonic; globally trend-ordered by allocated ranges | `IdSegmentD