Skip to content

Commit 1958552

Browse files
authored
docs: get started (#68)
1 parent 2dded63 commit 1958552

18 files changed

Lines changed: 4178 additions & 528 deletions

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"Bash(grep:*)",
99
"Bash(npm start)",
1010
"Bash(npx docusaurus:*)",
11-
"Bash(rm:*)"
11+
"Bash(rm:*)",
12+
"Bash(git add:*)"
1213
],
1314
"deny": []
1415
}

CLAUDE.md

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,211 @@ Flamingock is a **"Change-as-Code" platform** that versions and orchestrates any
6363
- Real-time dashboard, alerts, RBAC and multi-environment.
6464
- No infrastructure operations or audit store backups.
6565

66+
## Core Value Proposition & Philosophy
67+
68+
### Flamingock Guarantee
69+
"Your system will always be left in a known, auditable, and consistent state — no matter what happens."
70+
71+
### Safety-First Philosophy
72+
- **Default to safety**: When uncertain, stop and alert rather than corrupt
73+
- **Explicit flexibility**: Advanced users can opt into automatic retry for idempotent operations
74+
- **Complete audit trail**: Every action, success, and failure is tracked
75+
- **Deterministic state**: Always know exactly what happened and what needs to happen next
76+
77+
### Edition Positioning
78+
- **Community Edition**: Secure + Functional
79+
- Complete safety guarantees
80+
- Manual intervention when needed
81+
- Full audit capabilities
82+
- Covers essential enterprise needs
83+
84+
- **Cloud Edition**: Secure + Resilient + Automatic
85+
- Same configuration options as Community
86+
- Enhanced automatic resolution through advanced mechanisms
87+
- Better resilience through markers and reconciliation
88+
- Premium value: "Same settings, better outcomes"
89+
90+
## Flamingock Architecture
91+
92+
### Target Systems vs Audit Store
93+
94+
Flamingock operates with a dual-system architecture that's critical to understand:
95+
96+
#### Target Systems
97+
**Target Systems** are where your business changes are applied - the systems you're actually migrating or evolving:
98+
99+
- **Examples**: User database, Product catalog, Order management system, Payment processing DB
100+
- **Purpose**: Store and process your business data
101+
- **Changes applied**: Business logic migrations, schema updates, data transformations
102+
- **Annotation**: `@TargetSystem("user-database")`
103+
104+
#### Audit Store
105+
**Audit Store** is where Flamingock tracks execution history and state - completely separate from your business systems:
106+
107+
- **Examples**: Dedicated audit database, separate MongoDB collection, audit service
108+
- **Purpose**: Store execution logs, audit entries, issue tracking, compliance data
109+
- **Changes applied**: None - read-only for your business logic, write-only for Flamingock
110+
- **Configuration**: Set up once in Flamingock configuration, not in individual changes
111+
112+
#### Key Differences
113+
114+
| Aspect | Target System | Audit Store |
115+
|--------------------|---------------------------------|-------------------------------------|
116+
| **Purpose** | Business data and logic | Execution tracking and compliance |
117+
| **Modified by** | Your @Execution methods | Flamingock framework automatically |
118+
| **Access pattern** | Read/Write by your code | Read/Write by Flamingock |
119+
| **Examples** | `user-db`, `inventory-system` | `flamingock-audit`, `audit-service` |
120+
| **Failure impact** | Business functionality affected | Only tracking affected |
121+
| **Recovery scope** | Business data recovery | Audit trail recovery |
122+
123+
### Target Systems and Transactionality
124+
125+
Flamingock works with two types of target systems:
126+
127+
#### Transactional Target Systems
128+
- **Examples**: PostgreSQL, MySQL, MongoDB (4.0+), Oracle
129+
- **Native Capabilities**: Built-in rollback, atomicity, consistency guarantees
130+
- **In Flamingock**: Changes can leverage native transactions via `@ChangeUnit(transactional = true)`
131+
- **Rollback Strategy**: Automatic (database handles it) or manual via `@RollbackExecution`
132+
133+
#### Non-Transactional Target Systems
134+
- **Examples**: Kafka, S3, ElasticSearch, REST APIs, File Systems, MongoDB (pre-4.0)
135+
- **Native Capabilities**: No built-in rollback mechanism, no atomicity guarantees
136+
- **In Flamingock**: All changes are `transactional = false`
137+
- **Rollback Strategy**: Manual only via `@RollbackExecution` (user-provided compensation logic)
138+
139+
## Recovery Strategies
140+
141+
Flamingock provides two configurable recovery strategies:
142+
143+
### MANUAL_INTERVENTION (Default)
144+
**Philosophy**: "When in doubt, stop and alert."
145+
146+
- **When it activates**: Any failure where state is uncertain
147+
- **What happens**: Execution stops, issue logged, requires human review via CLI or Cloud UI
148+
- **Why it's default**: Prevents silent data corruption
149+
- **Best for**: Critical data migrations, non-idempotent operations, systems where correctness > availability
150+
151+
### ALWAYS_RETRY
152+
**Philosophy**: "Keep trying until successful."
153+
154+
- **When it activates**: Any failure, regardless of state
155+
- **What happens**: Automatic retry on next execution, no manual intervention required
156+
- **Why opt-in**: Requires idempotent operations
157+
- **Best for**: Idempotent operations, event publishing, cache warming, non-critical updates
158+
159+
### Cloud Edition Enhanced Recovery
160+
Cloud Edition uses the **same recovery strategies** but provides **enhanced outcomes**:
161+
162+
- **Enhanced MANUAL_INTERVENTION**: Automatic issue detection with real-time alerts, detailed diagnostics, workflow automation, team collaboration
163+
- **Enhanced ALWAYS_RETRY**: Intelligent retry backoff, marker mechanism for safe retries, automatic reconciliation, circuit breaker patterns
164+
- **Marker Mechanism**: Uses markers in transactional systems to determine safe recovery actions
165+
- **Enterprise Features**: Multi-region coordination, zero-downtime migrations, compliance reporting, SLA guarantees
166+
167+
## Audit States and Issue Resolution
168+
169+
### Audit States
170+
- **Success States**: EXECUTED, ROLLED_BACK, MANUAL_MARKED_AS_EXECUTED
171+
- **Failure States** (Create Issues): STARTED, EXECUTION_FAILED, ROLLBACK_FAILED
172+
- **Resolution States**: MANUAL_MARKED_AS_EXECUTED, MANUAL_MARKED_AS_ROLLED_BACK
173+
174+
### Issue Detection
175+
An "issue" is detected when:
176+
1. Audit entry is in a failure state
177+
2. Change is required to run again
178+
3. Recovery strategy determines next action
179+
180+
### CLI Resolution Commands
181+
```bash
182+
# List all issues
183+
flamingock issue list
184+
185+
# Get detailed issue information
186+
flamingock issue get -c change-id --guidance
187+
188+
# Fix an issue (mark as resolved)
189+
flamingock audit fix -c change-id
190+
```
191+
192+
## Competitive Differentiation
193+
194+
### vs Traditional Migration Tools
195+
196+
| Aspect | Flyway/Liquibase | Mongock | Flamingock |
197+
|-------------------------|--------------------|------------------------|-------------------------|
198+
| **Focus** | SQL databases | MongoDB only | All systems |
199+
| **Distributed Systems** | ❌ Not designed for | ❌ Limited | ✅ First-class support |
200+
| **Non-transactional** | ❌ No support | ❌ Assumes transactions | ✅ Full support |
201+
| **Failure Handling** | Retry blindly | Retry blindly | Configurable strategies |
202+
| **Audit Trail** | Basic | Basic | Comprehensive |
203+
| **Issue Resolution** | Manual SQL | None | CLI + Cloud automation |
204+
| **Safety Default** | None | None | MANUAL_INTERVENTION |
205+
206+
### Unique Value Propositions
207+
1. **Only platform addressing distributed systems holistically** - Not just databases, but Kafka, S3, APIs, etc.
208+
2. **Safety-first design philosophy** - Default to manual intervention, explicit opt-in for automatic retry
209+
3. **Enterprise-grade audit and compliance** - Complete audit trail, issue tracking, compliance reporting
210+
4. **Progressive enhancement model** - Community provides essential safety, Cloud enhances outcomes with same config
211+
212+
## Common Patterns and Best Practices
213+
214+
### Pattern 1: Idempotent by Design
215+
Make changes idempotent when possible, then use ALWAYS_RETRY:
216+
- INSERT ... ON CONFLICT DO NOTHING
217+
- PUT with same key-value
218+
- CREATE IF NOT EXISTS
219+
220+
### Pattern 2: Critical Path Protection
221+
Keep MANUAL_INTERVENTION for critical data paths:
222+
- Financial transactions
223+
- User authentication data
224+
- Compliance-related changes
225+
226+
### Pattern 3: Progressive Migration
227+
Start with MANUAL_INTERVENTION, move to ALWAYS_RETRY after validation
228+
229+
### Pattern 4: Transactional vs Non-Transactional Strategy
230+
- **Large bulk operations**: Non-transactional for performance, MANUAL_INTERVENTION for safety
231+
- **Small critical operations**: Transactional for safety, MANUAL_INTERVENTION for consistency
232+
233+
### @RollbackExecution Best Practice
234+
**Always provide @RollbackExecution methods** even for transactional changes:
235+
1. **For transactional changes**: Used for CLI undo operations (not executed on failure)
236+
2. **For non-transactional changes**: Executed automatically on failure to clean up
237+
3. **CLI integration**: Essential for `flamingock undo` command functionality
238+
4. **Audit compliance**: Provides clear trail of how changes can be reversed
239+
240+
## CRITICAL: Flamingock Transaction Behavior
241+
242+
**Important Technical Detail**: Even in Community Edition, audit operations and target system changes are ALWAYS executed in separate transactions:
243+
244+
### Transaction Separation Rules
245+
1. **Non-transactional target systems**: No transactions at all - neither the change nor audit
246+
2. **Transactional target systems**: Change executes in one transaction, audit writes in a separate transaction
247+
3. **Same database as audit store**: Still separate transactions - target system transaction + separate audit transaction
248+
249+
### Recovery Implications
250+
- **Community Edition**: Flamingock can recover the majority of failure scenarios through separate transaction approach
251+
- **Uncertain scenarios**: When Flamingock saves "started" audit but fails before saving completion status
252+
- **Cloud Edition**: Marker mechanism provides 100% recovery even in uncertain scenarios
253+
254+
### Key Point
255+
**NEVER document that audit and changes happen in the same transaction** - this is architecturally incorrect for Flamingock's design.
256+
257+
## Cloud Edition Advanced Features (Future/Roadmap)
258+
259+
### Custom Marker Mechanisms for Non-Transactional Systems
260+
**Status**: Planned for Cloud Edition (not yet implemented)
261+
262+
**Concept**: Similar to how markers work for transactional target systems (to check if change was applied or not), Cloud Edition will provide an option for users to supply custom mechanisms for non-transactional systems to determine:
263+
- Was the change successfully applied?
264+
- Was it not applied at all?
265+
- Was it partially applied?
266+
267+
**Value**: This custom marker capability will enable Cloud Edition to provide complete recoverability even for non-transactional systems (Kafka, S3, APIs, etc.) by allowing users to define their own validation logic for change state determination.
268+
269+
**Documentation Note**: Mention this briefly in non-transactional sections as "Cloud Edition will provide custom marker mechanisms for enhanced recoverability" but don't elaborate details since it's not yet implemented.
270+
66271

67272
## Development Commands
68273

@@ -146,6 +351,18 @@ yarn swizzle # Eject Docusaurus components for customization
146351
- Search functionality requires Algolia configuration
147352
- Mermaid diagrams are supported throughout the documentation
148353

354+
## Documentation Style Guidelines
355+
356+
### Title Capitalization
357+
- Use sentence case for titles and headers (capitalize only first word and proper nouns)
358+
- Avoid uppercase for words that are not the first word or proper names
359+
- Example: "Recovery strategies" not "Recovery Strategies"
360+
361+
### Content Style
362+
- Avoid emojis in documentation sections unless explicitly requested
363+
- Keep technical documentation professional and clean
364+
- Focus on clarity and readability over decoration
365+
149366
## Request Evaluation Framework
150367

151368
**CRITICAL**: Before proceeding with any request, Claude must evaluate it against these three criteria and score each from 1-10. If any criterion scores below 8, Claude must ask for clarification to ensure all criteria reach at least 8 before proceeding:

0 commit comments

Comments
 (0)