$ show flamingock/flamingock-java
Flamingock is a Java library for applying versioned, auditable 'change-as-code' migrations to databases and external systems, evolved from Mongock. At runtime it discovers annotated @Change classes or YAML change templates, orders them into pipeline stages, acquires a distributed lock, executes each change with optional transaction/rollback semantics, and records an audit trail. It supports Mongo DB (sync/reactive/Spring Data), SQL dialects, DynamoDB, and Couchbase, and ships both a community edition (local audit stores) and a cloud edition (HTTP client for a SaaS backend). The project also provides Spring Boot auto-configuration, a Gradle plugin, an annotation processor, a CLI runner, GraalVM native-image support, and legacy Mongock importers. Architecturally this is a multi-module Gradle build with a clean separation between core execution, audit-persistence abstractions, target-system adapters, and platform integrations. The code is heavily tested, including Testcontainers-based end-to-end tests across database backends, conformance suites for audit compaction, and wire-contract tests for the cloud API. However, the breadth of supported backends leads to notable duplication across MongoDB sync/reactive, DynamoDB, Couchbase, and SQL modules, and a few documented deficiencies are accepted as known test behavior rather than fixed. Overall it is a production-grade, actively maintained framework with strong engineering discipline and a few genuinely reusable patterns embedded among its internal abstractions.
The LLM identified 3 files worth highlighting for reuse:
Generic, self-contained parser for configuration placeholders like ${name} and ${name:default}, with fail-fast malformed-syntax handling and pluggable value validators. It is fully decoupled from Flamingock's domain and could be copied directly into any Java project needing type-safe, validated property placeholder resolution.
Encapsulates a careful sequencing algorithm for appending journal events to a distributed store, enforcing contiguous stream positions and SHA-256 idempotency keys under a single-writer lock invariant. The design demonstrates non-obvious concurrency reasoning and is reusable as a template for any event-sourcing system that must guarantee ordered, idempotent event streams.
A background lock-refresh daemon with proportional sleep and interrupt-safe shutdown, abstracted over the lock service and lock abstractions. It solves the common distributed-locking problem of keeping a lease alive without consuming unnecessary CPU, and can be extracted for use in other distributed lock implementations.