@radicaltools/mcp 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +148 -2
- package/dist/chunk-OGN3UW2D.js +2594 -0
- package/dist/elkLayout-S62RLGTO.js +8 -0
- package/dist/hub-catalogue/adr/adr-api-versioning.radical +53 -0
- package/dist/hub-catalogue/adr/adr-auth-strategy.radical +53 -0
- package/dist/hub-catalogue/adr/adr-caching-strategy.radical +59 -0
- package/dist/hub-catalogue/adr/adr-data-consistency-model.radical +40 -0
- package/dist/hub-catalogue/adr/adr-data-store.radical +47 -0
- package/dist/hub-catalogue/adr/adr-deployment-strategy.radical +53 -0
- package/dist/hub-catalogue/adr/adr-event-schema-evolution.radical +53 -0
- package/dist/hub-catalogue/adr/adr-integration-style.radical +50 -0
- package/dist/hub-catalogue/adr/adr-ledger-reconciliation-strategy.radical +38 -0
- package/dist/hub-catalogue/adr/adr-llm-provider-strategy.radical +40 -0
- package/dist/hub-catalogue/adr/adr-marketplace-payments-model.radical +39 -0
- package/dist/hub-catalogue/adr/adr-multi-region.radical +60 -0
- package/dist/hub-catalogue/adr/adr-multi-tenancy-strategy.radical +41 -0
- package/dist/hub-catalogue/adr/adr-observability.radical +59 -0
- package/dist/hub-catalogue/adr/adr-realtime-transport.radical +38 -0
- package/dist/hub-catalogue/adr/adr-tech-stack.radical +45 -0
- package/dist/hub-catalogue/adr/adr-zero-trust-network.radical +40 -0
- package/dist/hub-catalogue/blueprint/bp-ai-assistant-platform.radical +1641 -0
- package/dist/hub-catalogue/blueprint/bp-analytical-data-platform.radical +1428 -0
- package/dist/hub-catalogue/blueprint/bp-ecommerce-platform.radical +1989 -0
- package/dist/hub-catalogue/blueprint/bp-fintech-ledger-platform.radical +1701 -0
- package/dist/hub-catalogue/blueprint/bp-marketplace-platform.radical +1792 -0
- package/dist/hub-catalogue/blueprint/bp-realtime-collaboration.radical +1421 -0
- package/dist/hub-catalogue/blueprint/bp-saas-b2b-platform.radical +1713 -0
- package/dist/hub-catalogue/fitness-function/ff-accessibility-scan.radical +34 -0
- package/dist/hub-catalogue/fitness-function/ff-ai-eval-gate.radical +52 -0
- package/dist/hub-catalogue/fitness-function/ff-api-contract.radical +36 -0
- package/dist/hub-catalogue/fitness-function/ff-capacity-load-test.radical +67 -0
- package/dist/hub-catalogue/fitness-function/ff-carbon-footprint-guard.radical +62 -0
- package/dist/hub-catalogue/fitness-function/ff-change-failure-rate.radical +45 -0
- package/dist/hub-catalogue/fitness-function/ff-chaos-resilience-test.radical +53 -0
- package/dist/hub-catalogue/fitness-function/ff-cost-efficiency-guard.radical +64 -0
- package/dist/hub-catalogue/fitness-function/ff-coupling-guard.radical +45 -0
- package/dist/hub-catalogue/fitness-function/ff-data-integrity-check.radical +51 -0
- package/dist/hub-catalogue/fitness-function/ff-data-residency.radical +43 -0
- package/dist/hub-catalogue/fitness-function/ff-dependency-rules.radical +37 -0
- package/dist/hub-catalogue/fitness-function/ff-deploy-frequency.radical +46 -0
- package/dist/hub-catalogue/fitness-function/ff-dr-drill-success.radical +52 -0
- package/dist/hub-catalogue/fitness-function/ff-duplication-guard.radical +53 -0
- package/dist/hub-catalogue/fitness-function/ff-error-budget.radical +59 -0
- package/dist/hub-catalogue/fitness-function/ff-fail-safe-verification.radical +34 -0
- package/dist/hub-catalogue/fitness-function/ff-infra-drift.radical +34 -0
- package/dist/hub-catalogue/fitness-function/ff-latency-slo.radical +59 -0
- package/dist/hub-catalogue/fitness-function/ff-lead-time.radical +44 -0
- package/dist/hub-catalogue/fitness-function/ff-ledger-balance-integrity.radical +45 -0
- package/dist/hub-catalogue/fitness-function/ff-license-compliance.radical +43 -0
- package/dist/hub-catalogue/fitness-function/ff-mttr.radical +45 -0
- package/dist/hub-catalogue/fitness-function/ff-noisy-neighbor-guard.radical +66 -0
- package/dist/hub-catalogue/fitness-function/ff-sast-scan.radical +35 -0
- package/dist/hub-catalogue/fitness-function/ff-scale-out-verification.radical +66 -0
- package/dist/hub-catalogue/fitness-function/ff-security-scan.radical +45 -0
- package/dist/hub-catalogue/fitness-function/ff-startup-shutdown-check.radical +66 -0
- package/dist/hub-catalogue/fitness-function/ff-sync-convergence-test.radical +45 -0
- package/dist/hub-catalogue/fitness-function/ff-test-coverage.radical +43 -0
- package/dist/hub-catalogue/fitness-function/ff-web-vitals.radical +57 -0
- package/dist/hub-catalogue/pattern/pattern-anti-corruption-layer.radical +88 -0
- package/dist/hub-catalogue/pattern/pattern-api-gateway.radical +168 -0
- package/dist/hub-catalogue/pattern/pattern-bff.radical +179 -0
- package/dist/hub-catalogue/pattern/pattern-bulkhead.radical +114 -0
- package/dist/hub-catalogue/pattern/pattern-circuit-breaker.radical +219 -0
- package/dist/hub-catalogue/pattern/pattern-cqrs.radical +195 -0
- package/dist/hub-catalogue/pattern/pattern-crdt-sync.radical +200 -0
- package/dist/hub-catalogue/pattern/pattern-event-driven.radical +210 -0
- package/dist/hub-catalogue/pattern/pattern-event-sourced-ledger.radical +211 -0
- package/dist/hub-catalogue/pattern/pattern-hexagonal.radical +196 -0
- package/dist/hub-catalogue/pattern/pattern-microservices.radical +262 -0
- package/dist/hub-catalogue/pattern/pattern-rag-pipeline.radical +213 -0
- package/dist/hub-catalogue/pattern/pattern-rate-limiter.radical +114 -0
- package/dist/hub-catalogue/pattern/pattern-saga.radical +208 -0
- package/dist/hub-catalogue/pattern/pattern-sidecar.radical +123 -0
- package/dist/hub-catalogue/pattern/pattern-strangler-fig.radical +227 -0
- package/dist/hub-catalogue/pattern/pattern-transactional-outbox.radical +209 -0
- package/dist/hub-catalogue/requirement/req-accessibility.radical +48 -0
- package/dist/hub-catalogue/requirement/req-ai-autonomous-resolution.radical +51 -0
- package/dist/hub-catalogue/requirement/req-ai-groundedness.radical +45 -0
- package/dist/hub-catalogue/requirement/req-ai-human-handoff.radical +46 -0
- package/dist/hub-catalogue/requirement/req-alerting.radical +52 -0
- package/dist/hub-catalogue/requirement/req-api-response-time.radical +51 -0
- package/dist/hub-catalogue/requirement/req-api-standard.radical +45 -0
- package/dist/hub-catalogue/requirement/req-audit-logging.radical +43 -0
- package/dist/hub-catalogue/requirement/req-auth-response-time.radical +45 -0
- package/dist/hub-catalogue/requirement/req-auth.radical +43 -0
- package/dist/hub-catalogue/requirement/req-autoscaling.radical +62 -0
- package/dist/hub-catalogue/requirement/req-availability.radical +50 -0
- package/dist/hub-catalogue/requirement/req-backward-compatibility.radical +46 -0
- package/dist/hub-catalogue/requirement/req-batch-job-completion.radical +50 -0
- package/dist/hub-catalogue/requirement/req-carbon-efficiency.radical +64 -0
- package/dist/hub-catalogue/requirement/req-centralised-logging.radical +45 -0
- package/dist/hub-catalogue/requirement/req-ci-pipeline-time.radical +43 -0
- package/dist/hub-catalogue/requirement/req-code-complexity.radical +43 -0
- package/dist/hub-catalogue/requirement/req-config-propagation.radical +45 -0
- package/dist/hub-catalogue/requirement/req-data-integrity.radical +35 -0
- package/dist/hub-catalogue/requirement/req-data-retention.radical +44 -0
- package/dist/hub-catalogue/requirement/req-db-query-response.radical +44 -0
- package/dist/hub-catalogue/requirement/req-disaster-recovery.radical +59 -0
- package/dist/hub-catalogue/requirement/req-distributed-tracing.radical +45 -0
- package/dist/hub-catalogue/requirement/req-encryption.radical +49 -0
- package/dist/hub-catalogue/requirement/req-error-rate.radical +45 -0
- package/dist/hub-catalogue/requirement/req-error-recovery.radical +34 -0
- package/dist/hub-catalogue/requirement/req-event-schema-compatibility.radical +37 -0
- package/dist/hub-catalogue/requirement/req-fail-safe-default.radical +55 -0
- package/dist/hub-catalogue/requirement/req-fast-startup-graceful-shutdown.radical +69 -0
- package/dist/hub-catalogue/requirement/req-gdpr-erasure.radical +44 -0
- package/dist/hub-catalogue/requirement/req-graceful-degradation.radical +39 -0
- package/dist/hub-catalogue/requirement/req-health-checks.radical +43 -0
- package/dist/hub-catalogue/requirement/req-iac.radical +36 -0
- package/dist/hub-catalogue/requirement/req-idempotency.radical +47 -0
- package/dist/hub-catalogue/requirement/req-input-validation.radical +37 -0
- package/dist/hub-catalogue/requirement/req-least-privilege.radical +47 -0
- package/dist/hub-catalogue/requirement/req-ledger-immutability.radical +38 -0
- package/dist/hub-catalogue/requirement/req-mfa.radical +36 -0
- package/dist/hub-catalogue/requirement/req-ml-extraction-accuracy.radical +42 -0
- package/dist/hub-catalogue/requirement/req-onboarding-time.radical +42 -0
- package/dist/hub-catalogue/requirement/req-page-load-time.radical +59 -0
- package/dist/hub-catalogue/requirement/req-payout-latency.radical +46 -0
- package/dist/hub-catalogue/requirement/req-presence-latency.radical +46 -0
- package/dist/hub-catalogue/requirement/req-rate-limiting.radical +45 -0
- package/dist/hub-catalogue/requirement/req-report-generation.radical +44 -0
- package/dist/hub-catalogue/requirement/req-resource-efficiency.radical +64 -0
- package/dist/hub-catalogue/requirement/req-resource-headroom.radical +53 -0
- package/dist/hub-catalogue/requirement/req-resource-isolation.radical +37 -0
- package/dist/hub-catalogue/requirement/req-search-response-time.radical +44 -0
- package/dist/hub-catalogue/requirement/req-secrets-management.radical +45 -0
- package/dist/hub-catalogue/requirement/req-task-success-rate.radical +42 -0
- package/dist/hub-catalogue/requirement/req-test-coverage.radical +42 -0
- package/dist/hub-catalogue/requirement/req-throughput.radical +55 -0
- package/dist/hub-catalogue/requirement/req-vulnerability-scanning.radical +52 -0
- package/dist/hub-catalogue/requirement/req-zero-downtime-deploy.radical +39 -0
- package/dist/index.js +19422 -0
- package/package.json +48 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-api-versioning",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "API Versioning Policy",
|
|
6
|
+
"description": "Records how public APIs are versioned, what counts as a breaking change and how deprecations are communicated.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"api",
|
|
9
|
+
"versioning",
|
|
10
|
+
"compatibility",
|
|
11
|
+
"governance"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"templateParams": [
|
|
15
|
+
{
|
|
16
|
+
"key": "VERSIONING_SCHEME",
|
|
17
|
+
"label": "Versioning scheme",
|
|
18
|
+
"hint": "URL path major version (/v1, /v2)",
|
|
19
|
+
"defaultValue": "URL path major version (/v1, /v2)"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"key": "DEPRECATION_MONTHS",
|
|
23
|
+
"label": "Minimum deprecation period (months)",
|
|
24
|
+
"hint": "6",
|
|
25
|
+
"defaultValue": "6"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"hubRefs": [
|
|
29
|
+
"req-backward-compatibility",
|
|
30
|
+
"req-api-standard",
|
|
31
|
+
"ff-api-contract"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"nodes": [
|
|
35
|
+
{
|
|
36
|
+
"id": "adr-api-versioning-1",
|
|
37
|
+
"type": "adr",
|
|
38
|
+
"label": "ADR: {{VERSIONING_SCHEME}} API versioning",
|
|
39
|
+
"x": 0,
|
|
40
|
+
"y": 0,
|
|
41
|
+
"width": 180,
|
|
42
|
+
"height": 52,
|
|
43
|
+
"collapsed": false,
|
|
44
|
+
"status": "proposed",
|
|
45
|
+
"date": "",
|
|
46
|
+
"context": "Public and partner APIs must evolve without breaking existing clients, which upgrade on their own schedule. The team needs one rule for what is a breaking change, how a new version is exposed and how long old versions are supported, so that every service does not invent its own policy.",
|
|
47
|
+
"decision": "Version public APIs with {{VERSIONING_SCHEME}}. Additive changes (new optional fields, new endpoints, new enum values where documented as open) are non-breaking and ship within the current version. Removing or renaming fields, changing types or semantics, or tightening validation is breaking and requires a new major version. Deprecated versions remain fully functional for at least {{DEPRECATION_MONTHS}} months, announced via a Deprecation header, the changelog and direct notice to registered consumers.",
|
|
48
|
+
"consequences": "• Clients can rely on a stable contract within a major version and plan migrations.\n• Running two major versions in parallel is normal; the implementation must support it (adapters or parallel routes).\n• The contract-diff check in CI is the enforcement point; a breaking diff fails the build unless the major version changes.\n• Clients must tolerate unknown fields, and this is stated in the API guidelines.\n• Internal service-to-service APIs may use a lighter policy when all consumers are known and deploy together.",
|
|
49
|
+
"alternatives": "1. Header or media-type versioning — cleaner URLs; harder to test in a browser and easy to omit by mistake.\n2. Date-based versioning per account (Stripe style) — fine-grained and gentle for clients; significant implementation complexity.\n3. No versioning, only additive changes forever — simple; accumulates dead fields and eventually forces a big-bang break.\n4. Version per endpoint — maximum flexibility; consumers must track many version numbers."
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"relations": []
|
|
53
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-auth-strategy",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Authentication Strategy",
|
|
6
|
+
"description": "Records how users and machine clients authenticate, and where token validation happens.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"security",
|
|
9
|
+
"authentication",
|
|
10
|
+
"identity"
|
|
11
|
+
],
|
|
12
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
13
|
+
"templateParams": [
|
|
14
|
+
{
|
|
15
|
+
"key": "AUTH_MECHANISM",
|
|
16
|
+
"label": "Authentication mechanism",
|
|
17
|
+
"hint": "OAuth 2.0 / OIDC with an external IdP",
|
|
18
|
+
"defaultValue": "OAuth 2.0 / OIDC with an external IdP"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"key": "TOKEN_LIFETIME_MINUTES",
|
|
22
|
+
"label": "Access-token lifetime (min)",
|
|
23
|
+
"hint": "15",
|
|
24
|
+
"defaultValue": "15"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"hubRefs": [
|
|
28
|
+
"req-auth",
|
|
29
|
+
"req-mfa",
|
|
30
|
+
"pattern-api-gateway",
|
|
31
|
+
"adr-zero-trust-network"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"nodes": [
|
|
35
|
+
{
|
|
36
|
+
"id": "adr-auth-strategy-1",
|
|
37
|
+
"type": "adr",
|
|
38
|
+
"label": "ADR: {{AUTH_MECHANISM}} for authentication",
|
|
39
|
+
"x": 0,
|
|
40
|
+
"y": 0,
|
|
41
|
+
"width": 180,
|
|
42
|
+
"height": 52,
|
|
43
|
+
"collapsed": false,
|
|
44
|
+
"status": "proposed",
|
|
45
|
+
"date": "",
|
|
46
|
+
"context": "Human users and machine clients must authenticate to the APIs. Requirements include single sign-on with the organisation's identity provider, stateless verification at the API layer, short-lived credentials with refresh, revocation on compromise, support for service-to-service calls, and MFA for privileged operations. Building and operating an in-house credential store is a liability the team wants to avoid.",
|
|
47
|
+
"decision": "Use {{AUTH_MECHANISM}}. Users authenticate with the Authorization Code flow with PKCE; services use the Client Credentials flow. Access tokens are JWTs with a lifetime of {{TOKEN_LIFETIME_MINUTES}} minutes, validated at the API gateway against the IdP's JWKS; refresh tokens are rotated on use and revoked server-side.",
|
|
48
|
+
"consequences": "• No passwords are stored or verified by our services.\n• Every service can validate tokens locally; the IdP is not on the request path.\n• Short token lifetimes bound the damage of a leaked token; revocation of long sessions is handled via refresh-token rotation.\n• The IdP becomes a critical dependency for login (not for already-issued tokens) and needs its own availability review.\n• Authorisation (roles, scopes, tenant claims) must be designed on top; authentication alone does not decide what a caller may do.",
|
|
49
|
+
"alternatives": "1. Server-side sessions with cookies — simple for a single web app; does not fit APIs consumed by multiple clients and services.\n2. Self-issued JWTs with our own user store — full control; we own credential storage, password policy, MFA and breach response.\n3. API keys per client — trivial to implement; no identity of the human behind the call, hard to rotate, no standard for scopes.\n4. Mutual TLS for all clients — strong service-to-service story; impractical for browsers and mobile apps."
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"relations": []
|
|
53
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-caching-strategy",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Caching Strategy",
|
|
6
|
+
"description": "Records where and how data is cached, how cache entries are invalidated and what staleness is acceptable.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"performance",
|
|
9
|
+
"caching",
|
|
10
|
+
"data",
|
|
11
|
+
"scalability"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"templateParams": [
|
|
15
|
+
{
|
|
16
|
+
"key": "CACHE_PATTERN",
|
|
17
|
+
"label": "Cache pattern",
|
|
18
|
+
"hint": "Cache-aside",
|
|
19
|
+
"defaultValue": "Cache-aside"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"key": "CACHE_STORE",
|
|
23
|
+
"label": "Cache store",
|
|
24
|
+
"hint": "Redis",
|
|
25
|
+
"defaultValue": "Redis"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"key": "DEFAULT_TTL_SECONDS",
|
|
29
|
+
"label": "Default TTL (s)",
|
|
30
|
+
"hint": "300",
|
|
31
|
+
"defaultValue": "300"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"hubRefs": [
|
|
35
|
+
"req-api-response-time",
|
|
36
|
+
"req-db-query-response",
|
|
37
|
+
"adr-data-store"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"nodes": [
|
|
41
|
+
{
|
|
42
|
+
"id": "adr-caching-strategy-1",
|
|
43
|
+
"type": "adr",
|
|
44
|
+
"label": "ADR: {{CACHE_PATTERN}} caching with {{CACHE_STORE}}",
|
|
45
|
+
"x": 0,
|
|
46
|
+
"y": 0,
|
|
47
|
+
"width": 180,
|
|
48
|
+
"height": 52,
|
|
49
|
+
"collapsed": false,
|
|
50
|
+
"status": "proposed",
|
|
51
|
+
"date": "",
|
|
52
|
+
"context": "Read-heavy endpoints exceed their latency budget when every request reaches the database, and the database is the hardest tier to scale. Forces: how stale a read may be for each data class, the write frequency of cached data, the cost of a cache miss storm after a deployment, multi-instance consistency and the operational overhead of another stateful component.",
|
|
53
|
+
"decision": "Use {{CACHE_PATTERN}} caching backed by {{CACHE_STORE}} for read-mostly reference and aggregate data, with a default TTL of {{DEFAULT_TTL_SECONDS}} seconds and explicit invalidation on write for data classes where staleness is not acceptable. Cache keys include the schema version so deployments do not serve incompatible payloads. Caching is opt-in per data class and documented in the service's data catalogue.",
|
|
54
|
+
"consequences": "• Database load and p95 latency drop for the covered endpoints; the cache becomes part of the capacity model.\n• Every cached data class has a declared staleness budget; UI and API contracts state it.\n• Cache unavailability must degrade to direct reads, not to failure; the client library implements this fallback.\n• Thundering-herd protection (request coalescing, jittered TTLs) is required for hot keys.\n• Personal data in the cache is subject to the same encryption, residency and erasure rules as the primary store.",
|
|
55
|
+
"alternatives": "1. No caching, scale the database — simplest consistency; expensive and eventually hits a ceiling.\n2. Read-through / write-through cache — transparent to callers; couples every write to cache availability.\n3. CDN / HTTP caching only — excellent for public, anonymous content; useless for personalised responses.\n4. In-process cache per instance — no extra infrastructure; inconsistent across instances and lost on every deploy."
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"relations": []
|
|
59
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-data-consistency-model",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Data Consistency Model",
|
|
6
|
+
"description": "Records whether cross-service state changes are strongly or eventually consistent, and where the line between the two sits.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"consistency",
|
|
9
|
+
"distributed-systems",
|
|
10
|
+
"data",
|
|
11
|
+
"event-driven"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"hubRefs": [
|
|
15
|
+
"pattern-saga",
|
|
16
|
+
"pattern-cqrs",
|
|
17
|
+
"pattern-event-driven",
|
|
18
|
+
"req-idempotency",
|
|
19
|
+
"ff-data-integrity-check"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"nodes": [
|
|
23
|
+
{
|
|
24
|
+
"id": "adr-data-consistency-model-1",
|
|
25
|
+
"type": "adr",
|
|
26
|
+
"label": "ADR: Eventual consistency across service boundaries",
|
|
27
|
+
"width": 180,
|
|
28
|
+
"height": 52,
|
|
29
|
+
"collapsed": false,
|
|
30
|
+
"x": 0,
|
|
31
|
+
"y": 0,
|
|
32
|
+
"status": "proposed",
|
|
33
|
+
"date": "",
|
|
34
|
+
"context": "Data now lives in more than one service's database. Some workflows want the same read-your-writes guarantee a single database gave us for free; others just need to converge eventually. Treating every boundary as strongly consistent means distributed transactions, which cost availability and throughput.",
|
|
35
|
+
"decision": "Each service is strongly consistent within its own transactional boundary. Across service boundaries, consistency is eventual: state changes propagate as domain events, and consumers are built to tolerate a short, bounded lag rather than assume the source has already applied the change.",
|
|
36
|
+
"consequences": "• UIs that read a just-written value across a service boundary need an explicit strategy (optimistic UI, polling, or a synchronous read-your-writes API for that one case) rather than assuming instant propagation.\n• Sagas and event choreography replace distributed transactions for multi-service workflows.\n• Reconciliation jobs are still needed as a backstop for the rare cases where propagation silently fails.\n• Debugging \"why doesn't this read reflect that write\" becomes a recurring class of support question that needs tooling (event lag dashboards).",
|
|
37
|
+
"alternatives": "1. Distributed transactions (2PC/XA) — true strong consistency everywhere, but couples service availability together and doesn't survive partitions well.\n2. Strong consistency via a shared database — simplest mentally, but re-couples the services the boundary was meant to decouple.\n3. Eventual consistency via events (chosen) — services stay independently deployable and available; consumers must be designed for lag."
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-data-store",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Primary Data Store",
|
|
6
|
+
"description": "Records the choice of the main persistence technology and the data-model, consistency and operational trade-offs behind it.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"database",
|
|
9
|
+
"persistence",
|
|
10
|
+
"data"
|
|
11
|
+
],
|
|
12
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
13
|
+
"templateParams": [
|
|
14
|
+
{
|
|
15
|
+
"key": "DATABASE",
|
|
16
|
+
"label": "Chosen data store",
|
|
17
|
+
"hint": "PostgreSQL",
|
|
18
|
+
"defaultValue": "PostgreSQL"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"hubRefs": [
|
|
22
|
+
"adr-caching-strategy",
|
|
23
|
+
"req-data-integrity",
|
|
24
|
+
"req-db-query-response",
|
|
25
|
+
"adr-multi-tenancy-strategy"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"nodes": [
|
|
29
|
+
{
|
|
30
|
+
"id": "adr-data-store-1",
|
|
31
|
+
"type": "adr",
|
|
32
|
+
"label": "ADR: {{DATABASE}} as primary data store",
|
|
33
|
+
"x": 0,
|
|
34
|
+
"y": 0,
|
|
35
|
+
"width": 180,
|
|
36
|
+
"height": 52,
|
|
37
|
+
"collapsed": false,
|
|
38
|
+
"status": "proposed",
|
|
39
|
+
"date": "",
|
|
40
|
+
"context": "The service needs a primary store for its transactional data. Forces: shape of the data (relational vs document vs graph), consistency needs (strong vs eventual), dominant query patterns (point lookups, joins, aggregations, search), expected growth, managed-service availability in our cloud, backup/restore and point-in-time recovery, and the team's operational experience.",
|
|
41
|
+
"decision": "Use {{DATABASE}} as the primary transactional store. Specialised needs (full-text search, caching, analytics, time series) are served by purpose-built secondary stores fed from the primary, never the other way round.",
|
|
42
|
+
"consequences": "• Schema changes go through versioned, backward-compatible migrations run by the pipeline.\n• Backups, point-in-time recovery and restore drills are part of the operational baseline.\n• Secondary stores are derived data and may be rebuilt from the primary at any time.\n• Query patterns that fight the chosen model (e.g. deep graph traversal on a relational store) are a signal to introduce a dedicated store, not to bend the primary.\n• Vendor and managed-service lock-in is accepted in exchange for operational simplicity.",
|
|
43
|
+
"alternatives": "1. Document store (MongoDB, DynamoDB) — flexible schema and horizontal scale; weaker for ad-hoc joins and multi-document transactions.\n2. Distributed SQL (CockroachDB, Spanner, YugabyteDB) — relational model with geo-scale; higher cost and latency floor.\n3. Multi-model from day one — each store optimal for its use; operational and consistency complexity too high for the current team size.\n4. Event store as system of record — perfect audit trail; requires CQRS discipline across the whole service."
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"relations": []
|
|
47
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-deployment-strategy",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Deployment Strategy",
|
|
6
|
+
"description": "Records how new versions are rolled out to production and rolled back, balancing risk, speed and infrastructure cost.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"deployment",
|
|
9
|
+
"release",
|
|
10
|
+
"ci-cd",
|
|
11
|
+
"devops"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"templateParams": [
|
|
15
|
+
{
|
|
16
|
+
"key": "DEPLOY_STRATEGY",
|
|
17
|
+
"label": "Rollout strategy",
|
|
18
|
+
"hint": "Canary",
|
|
19
|
+
"defaultValue": "Canary"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"key": "CANARY_INITIAL_PCT",
|
|
23
|
+
"label": "Initial canary traffic (%)",
|
|
24
|
+
"hint": "5",
|
|
25
|
+
"defaultValue": "5"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"hubRefs": [
|
|
29
|
+
"req-zero-downtime-deploy",
|
|
30
|
+
"ff-change-failure-rate",
|
|
31
|
+
"ff-deploy-frequency"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"nodes": [
|
|
35
|
+
{
|
|
36
|
+
"id": "adr-deployment-strategy-1",
|
|
37
|
+
"type": "adr",
|
|
38
|
+
"label": "ADR: {{DEPLOY_STRATEGY}} deployments",
|
|
39
|
+
"x": 0,
|
|
40
|
+
"y": 0,
|
|
41
|
+
"width": 180,
|
|
42
|
+
"height": 52,
|
|
43
|
+
"collapsed": false,
|
|
44
|
+
"status": "proposed",
|
|
45
|
+
"date": "",
|
|
46
|
+
"context": "Releases must reach production without downtime, with a fast and reliable rollback and with early detection of regressions that tests did not catch. Forces: the availability target, whether the database schema can be evolved compatibly, the maturity of production metrics, infrastructure cost tolerance and the number of deployments per day the team aims for.",
|
|
47
|
+
"decision": "Use {{DEPLOY_STRATEGY}} deployments. New versions receive {{CANARY_INITIAL_PCT}}% of traffic first; promotion to 100% is automatic when error rate and latency SLIs stay within budget for the observation window, and rollback is automatic when they do not. All schema changes are expand/contract migrations so both versions can run side by side.",
|
|
48
|
+
"consequences": "• Regressions affect a small share of users and are rolled back automatically.\n• Requires reliable, low-latency SLIs — the deployment gate is only as good as the metrics.\n• Both versions run concurrently: database migrations, message schemas and caches must be compatible across N and N+1.\n• Feature flags decouple release from exposure and are used for changes that cannot be canaried by traffic share.\n• Slightly higher infrastructure cost during rollout; far lower than permanently duplicated environments.",
|
|
49
|
+
"alternatives": "1. Blue-green — instant switch and rollback; doubles the environment and still exposes 100% of users at once.\n2. Rolling update — lowest infrastructure overhead; slower rollback and no traffic-share control.\n3. Recreate (stop, then start) — simplest; incurs downtime and fails the zero-downtime requirement.\n4. Feature-flag-only releases — fine-grained exposure control; does not protect against faults in the new binary itself."
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"relations": []
|
|
53
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-event-schema-evolution",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Event Schema Evolution",
|
|
6
|
+
"description": "Records how event schemas are defined, registered and evolved so that producers and consumers can change independently.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"messaging",
|
|
9
|
+
"event-driven",
|
|
10
|
+
"schema",
|
|
11
|
+
"governance"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"templateParams": [
|
|
15
|
+
{
|
|
16
|
+
"key": "SCHEMA_FORMAT",
|
|
17
|
+
"label": "Schema format",
|
|
18
|
+
"hint": "Avro",
|
|
19
|
+
"defaultValue": "Avro"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"key": "COMPATIBILITY_MODE",
|
|
23
|
+
"label": "Registry compatibility mode",
|
|
24
|
+
"hint": "BACKWARD",
|
|
25
|
+
"defaultValue": "BACKWARD"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"hubRefs": [
|
|
29
|
+
"req-event-schema-compatibility",
|
|
30
|
+
"pattern-event-driven",
|
|
31
|
+
"adr-integration-style"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"nodes": [
|
|
35
|
+
{
|
|
36
|
+
"id": "adr-event-schema-evolution-1",
|
|
37
|
+
"type": "adr",
|
|
38
|
+
"label": "ADR: {{SCHEMA_FORMAT}} with a schema registry",
|
|
39
|
+
"x": 0,
|
|
40
|
+
"y": 0,
|
|
41
|
+
"width": 180,
|
|
42
|
+
"height": 52,
|
|
43
|
+
"collapsed": false,
|
|
44
|
+
"status": "proposed",
|
|
45
|
+
"date": "",
|
|
46
|
+
"context": "Events published to the broker are consumed by services owned by other teams, some unknown to the producer. Without a shared definition and compatibility rules, a field rename by a producer breaks consumers at runtime. Forces: payload size and serialisation speed, tooling for code generation, how strictly compatibility should be enforced and who owns each event.",
|
|
47
|
+
"decision": "Define every event with {{SCHEMA_FORMAT}} schemas registered in a schema registry under {{COMPATIBILITY_MODE}} compatibility. The registry rejects incompatible schema versions; the build pipeline runs the same check earlier. Each event type has an owning team, a documented purpose and a CloudEvents-style envelope (id, type, source, time, trace context).",
|
|
48
|
+
"consequences": "• Consumers can upgrade before or after producers within the compatibility rules; deploy ordering is no longer coupled.\n• Breaking changes require a new event type (or major version suffix) and a migration period, never an in-place change.\n• Code generation from schemas gives typed producers and consumers in every language in use.\n• The registry is a runtime dependency for serialisation and must be highly available and cached client-side.\n• Schema reviews become a lightweight governance step with a visible owner.",
|
|
49
|
+
"alternatives": "1. JSON without a registry — zero tooling; compatibility relies on convention and breaks silently.\n2. Protobuf with schemas in a shared repository — compact and typed; compatibility is enforced only by review unless a registry is added.\n3. JSON Schema with a registry — human-readable; weaker code generation and larger payloads.\n4. Versioned topics per schema change — explicit; topic sprawl and duplicated consumers."
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"relations": []
|
|
53
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-integration-style",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Service Integration Style",
|
|
6
|
+
"description": "Records the default way services communicate — synchronous calls, asynchronous events, or a defined mix — and when each is appropriate.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"integration",
|
|
9
|
+
"messaging",
|
|
10
|
+
"api",
|
|
11
|
+
"distributed-systems"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"templateParams": [
|
|
15
|
+
{
|
|
16
|
+
"key": "INTEGRATION_STYLE",
|
|
17
|
+
"label": "Default integration style",
|
|
18
|
+
"hint": "Sync REST for queries, async events for state changes",
|
|
19
|
+
"defaultValue": "Sync REST for queries, async events for state changes"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"hubRefs": [
|
|
23
|
+
"pattern-event-driven",
|
|
24
|
+
"pattern-circuit-breaker",
|
|
25
|
+
"req-graceful-degradation",
|
|
26
|
+
"adr-event-schema-evolution",
|
|
27
|
+
"pattern-bff",
|
|
28
|
+
"pattern-anti-corruption-layer"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"nodes": [
|
|
32
|
+
{
|
|
33
|
+
"id": "adr-integration-style-1",
|
|
34
|
+
"type": "adr",
|
|
35
|
+
"label": "ADR: {{INTEGRATION_STYLE}} between services",
|
|
36
|
+
"x": 0,
|
|
37
|
+
"y": 0,
|
|
38
|
+
"width": 180,
|
|
39
|
+
"height": 52,
|
|
40
|
+
"collapsed": false,
|
|
41
|
+
"status": "proposed",
|
|
42
|
+
"date": "",
|
|
43
|
+
"context": "Services need to exchange data and trigger work in each other. Synchronous request/response is simple to reason about but couples availability and latency along the call chain. Asynchronous messaging decouples producers from consumers and absorbs load, at the cost of eventual consistency and harder debugging. Forces: latency expectations, tolerance for stale data, failure isolation, ordering guarantees and the team's experience with brokers.",
|
|
44
|
+
"decision": "Adopt {{INTEGRATION_STYLE}}. Reads that a user is waiting on use synchronous calls with timeouts, retries with back-off and circuit breakers. State changes that other services need to know about are published as domain events through the message broker; consumers own their projections. Synchronous calls that fan out to more than two services are a design smell to be reviewed.",
|
|
45
|
+
"consequences": "• Services can be deployed and scaled independently; a slow consumer does not slow the producer.\n• Data is eventually consistent across services; UIs must be designed for it.\n• Every event needs a schema, an owner and a compatibility policy.\n• Distributed tracing and correlation ids across both calls and messages are mandatory for debuggability.\n• Idempotent consumers and the outbox pattern are required to avoid lost or duplicated events.",
|
|
46
|
+
"alternatives": "1. Synchronous only (REST/gRPC) — simplest mental model; availability of the whole chain is the product of its parts.\n2. Asynchronous only — maximal decoupling; awkward for request/response interactions and adds latency to every read.\n3. Shared database integration — no network hop; couples schemas across teams and defeats service autonomy.\n4. Orchestration via a workflow engine — explicit long-running processes; adds a central component and vendor coupling."
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"relations": []
|
|
50
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-ledger-reconciliation-strategy",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Ledger Reconciliation Strategy",
|
|
6
|
+
"description": "Records how the internal journal is kept in agreement with the external bank or processor record — continuously, in a nightly batch, or both.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"fintech",
|
|
9
|
+
"ledger",
|
|
10
|
+
"reconciliation",
|
|
11
|
+
"governance"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"hubRefs": [
|
|
15
|
+
"pattern-event-sourced-ledger",
|
|
16
|
+
"ff-ledger-balance-integrity",
|
|
17
|
+
"req-disaster-recovery"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"nodes": [
|
|
21
|
+
{
|
|
22
|
+
"id": "adr-ledger-reconciliation-strategy-1",
|
|
23
|
+
"type": "adr",
|
|
24
|
+
"label": "ADR: Continuous reconciliation with a nightly batch safety net",
|
|
25
|
+
"width": 180,
|
|
26
|
+
"height": 52,
|
|
27
|
+
"collapsed": false,
|
|
28
|
+
"x": 0,
|
|
29
|
+
"y": 0,
|
|
30
|
+
"status": "proposed",
|
|
31
|
+
"date": "",
|
|
32
|
+
"context": "The internal journal and the bank or processor's own records can disagree — a webhook is dropped, an event arrives out of order, a correction happens on the processor's side days later. Left undetected, that drift eventually surfaces as a customer-visible balance error.",
|
|
33
|
+
"decision": "Reconcile continuously: match each inbound settlement event against the journal within minutes of receipt. Back that with a nightly full batch reconciliation against the processor's end-of-day statement, which catches anything the event stream missed — a webhook that never arrived, a late correction, a duplicate.",
|
|
34
|
+
"consequences": "• Most discrepancies surface and are actionable within minutes, while the business context is still fresh.\n• The nightly batch is what actually guarantees completeness — it doesn't depend on every event having arrived, only on the processor's statement being authoritative — so it can't be skipped as \"redundant\" once continuous reconciliation is working.\n• Two reconciliation code paths, streaming and batch, need to agree on what \"matched\" means, or they produce contradictory exception reports.\n• Every discrepancy needs a place to land — a suspense account, not a dropped log line — or reconciliation becomes something that alerts but doesn't actually fix anything.",
|
|
35
|
+
"alternatives": "1. Nightly batch only — simplest to build, but a discrepancy from this morning sits undetected and possibly compounding until the batch runs.\n2. Continuous event-driven only — fast, but blind to anything the event stream itself missed, such as a webhook that was never delivered.\n3. Manual, periodic spreadsheet reconciliation — doesn't scale past a handful of transactions a day and depends entirely on someone remembering to run it.\n4. Continuous plus nightly batch safety net (chosen) — fast detection for the common case, with a completeness guarantee that doesn't depend on the event stream being perfect."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-llm-provider-strategy",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "LLM Provider Strategy",
|
|
6
|
+
"description": "Records whether model calls go to a hosted frontier API, a self-hosted open-weight model, or both routed by task.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"ai",
|
|
9
|
+
"llm",
|
|
10
|
+
"governance",
|
|
11
|
+
"cost",
|
|
12
|
+
"data-residency"
|
|
13
|
+
],
|
|
14
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
15
|
+
"hubRefs": [
|
|
16
|
+
"pattern-rag-pipeline",
|
|
17
|
+
"req-ai-groundedness",
|
|
18
|
+
"req-encryption",
|
|
19
|
+
"ff-cost-efficiency-guard"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"nodes": [
|
|
23
|
+
{
|
|
24
|
+
"id": "adr-llm-provider-strategy-1",
|
|
25
|
+
"type": "adr",
|
|
26
|
+
"label": "ADR: Hybrid LLM routing by task",
|
|
27
|
+
"width": 180,
|
|
28
|
+
"height": 52,
|
|
29
|
+
"collapsed": false,
|
|
30
|
+
"x": 0,
|
|
31
|
+
"y": 0,
|
|
32
|
+
"status": "proposed",
|
|
33
|
+
"date": "",
|
|
34
|
+
"context": "Every model call has to go somewhere: a hosted frontier API, a self-hosted open-weight model, or a mix. The right choice depends on task quality requirements, per-token cost at expected volume, latency, and whether the input data is allowed to leave the perimeter at all.",
|
|
35
|
+
"decision": "Default to a hosted frontier API for quality-critical, low-volume tasks (drafting, complex reasoning). Route high-volume, latency-sensitive or data-sensitive tasks (classification, extraction, redaction) to a self-hosted open-weight model behind the same internal completion interface, so callers don't know or care which one answered.",
|
|
36
|
+
"consequences": "• Quality-critical tasks keep pace with frontier model improvements without any migration; only the routing table changes as models are added.\n• High-volume tasks avoid per-token cost that would otherwise dominate the bill, at the cost of running and updating GPU infrastructure for the self-hosted model.\n• Data that cannot leave the perimeter has a compliant path (self-hosted) without blocking the product entirely on it.\n• The routing layer and its fallback behaviour — what happens when the preferred provider is down or rate-limited — becomes critical infrastructure in its own right, not an afterthought.",
|
|
37
|
+
"alternatives": "1. Always hosted API — simplest to build and keeps pace with frontier quality, but every request leaves the perimeter and cost scales linearly with volume regardless of task complexity.\n2. Always self-hosted — full control over data residency and cost at scale, but requires GPU operations expertise and typically lags frontier quality on complex reasoning tasks.\n3. Single hosted provider, no fallback — simplest integration, but a provider outage or pricing change has no mitigation.\n4. Hybrid routing by task (chosen) — matches each task to the provider it actually needs, at the cost of maintaining two integration paths and a routing policy."
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-marketplace-payments-model",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Marketplace Payments Model",
|
|
6
|
+
"description": "Records how money moves between buyer and seller — who legally holds funds in transit, when the platform's commission is taken, and what licensing obligations that creates.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"marketplace",
|
|
9
|
+
"payments",
|
|
10
|
+
"governance",
|
|
11
|
+
"compliance"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"hubRefs": [
|
|
15
|
+
"pattern-event-sourced-ledger",
|
|
16
|
+
"req-payout-latency",
|
|
17
|
+
"req-idempotency",
|
|
18
|
+
"adr-data-consistency-model"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"nodes": [
|
|
22
|
+
{
|
|
23
|
+
"id": "adr-marketplace-payments-model-1",
|
|
24
|
+
"type": "adr",
|
|
25
|
+
"label": "ADR: Facilitated split payments, platform never holds funds",
|
|
26
|
+
"width": 180,
|
|
27
|
+
"height": 52,
|
|
28
|
+
"collapsed": false,
|
|
29
|
+
"x": 0,
|
|
30
|
+
"y": 0,
|
|
31
|
+
"status": "proposed",
|
|
32
|
+
"date": "",
|
|
33
|
+
"context": "A two-sided marketplace moves money it doesn't ultimately own, from buyers to sellers, minus commission. How that money is held in transit determines whether the platform takes on money-transmitter obligations, who bears chargeback risk, and how hard it is to guarantee sellers actually get paid.",
|
|
34
|
+
"decision": "Use a managed payments-facilitator provider's split-payment product: the provider holds funds in transit and executes the split — seller share, platform commission — at payout time. The platform never custodies buyer funds directly; it only instructs the provider what split to apply and when to release it.",
|
|
35
|
+
"consequences": "• The platform operates as a facilitator under the provider's money-transmitter licence rather than needing its own, removing years of regulatory work from the critical path to launch.\n• Commission collection is guaranteed by construction — deducted before the seller is paid, not invoiced separately and hoped for.\n• The platform's control over payout timing is limited to what the provider's API exposes; a provider incident or policy change becomes a dependency the marketplace can't fully route around.\n• Refunds and chargebacks flow through the provider's split-payment reversal logic, which the order and dispute workflow must model explicitly rather than treating payment as one atomic step.",
|
|
36
|
+
"alternatives": "1. Platform as merchant of record, invoicing sellers for commission separately — the platform bears full chargeback and fraud liability on every transaction and likely crosses into money-transmitter territory on its own.\n2. Buyer pays seller directly, platform only invoices commission after the fact — simplest to build and clearly outside payments regulation, but the platform has no mechanism to guarantee it collects its commission or to protect buyers with a dispute process.\n3. Build a full in-house ledger and banking-rail integration — maximum control and no per-transaction provider fee, but a multi-year regulatory and engineering undertaking before the first transaction can move.\n4. Managed split-payment facilitator (chosen) — fastest path to a compliant, chargeback-protected marketplace, at the cost of depending on the provider's product and pricing."
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hub": {
|
|
3
|
+
"id": "adr-multi-region",
|
|
4
|
+
"category": "adr",
|
|
5
|
+
"name": "Multi-Region Topology",
|
|
6
|
+
"description": "Records how the system is distributed across regions to meet availability and disaster-recovery objectives.",
|
|
7
|
+
"tags": [
|
|
8
|
+
"availability",
|
|
9
|
+
"disaster-recovery",
|
|
10
|
+
"cloud",
|
|
11
|
+
"resilience"
|
|
12
|
+
],
|
|
13
|
+
"requiredMetamodel": "c4-ddd-governance-builtin",
|
|
14
|
+
"templateParams": [
|
|
15
|
+
{
|
|
16
|
+
"key": "TOPOLOGY",
|
|
17
|
+
"label": "Region topology",
|
|
18
|
+
"hint": "Active-passive with warm standby",
|
|
19
|
+
"defaultValue": "Active-passive with warm standby"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"key": "PRIMARY_REGION",
|
|
23
|
+
"label": "Primary region",
|
|
24
|
+
"hint": "eu-west-1",
|
|
25
|
+
"defaultValue": "eu-west-1"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"key": "SECONDARY_REGION",
|
|
29
|
+
"label": "Secondary region",
|
|
30
|
+
"hint": "eu-central-1",
|
|
31
|
+
"defaultValue": "eu-central-1"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"hubRefs": [
|
|
35
|
+
"req-disaster-recovery",
|
|
36
|
+
"req-availability",
|
|
37
|
+
"ff-data-residency",
|
|
38
|
+
"ff-dr-drill-success"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"nodes": [
|
|
42
|
+
{
|
|
43
|
+
"id": "adr-multi-region-1",
|
|
44
|
+
"type": "adr",
|
|
45
|
+
"label": "ADR: {{TOPOLOGY}} multi-region topology",
|
|
46
|
+
"x": 0,
|
|
47
|
+
"y": 0,
|
|
48
|
+
"width": 180,
|
|
49
|
+
"height": 52,
|
|
50
|
+
"collapsed": false,
|
|
51
|
+
"status": "proposed",
|
|
52
|
+
"date": "",
|
|
53
|
+
"context": "The availability target and the recovery objectives (RTO/RPO) cannot be met from a single region: a regional outage would exceed the allowed downtime. Forces: data residency constraints on where replicas may live, the consistency model the data store supports across regions, cost of duplicated capacity, and the operational complexity of failover and failback.",
|
|
54
|
+
"decision": "Run {{TOPOLOGY}}: {{PRIMARY_REGION}} serves all traffic; {{SECONDARY_REGION}} runs a scaled-down copy of the stateless tier and an asynchronously replicated database. Failover is triggered by health checks on the global load balancer and promotes the replica; failback is a planned operation. Failover is rehearsed on a fixed schedule.",
|
|
55
|
+
"consequences": "• RTO is bounded by replica promotion and DNS/traffic-manager propagation; RPO by replication lag, which is monitored and alerted.\n• Infrastructure cost rises by the standby footprint, well below the cost of full active-active.\n• All infrastructure must be defined as code and deployable to either region.\n• Application state outside the database (caches, queues, object storage) needs an explicit replication or rebuild plan.\n• Regular failover drills are non-negotiable; an untested failover is not a failover.",
|
|
56
|
+
"alternatives": "1. Single region, multiple availability zones — covers zone failures cheaply; does not survive a regional outage.\n2. Active-active across regions — near-zero RTO and better latency; requires conflict-free or globally consistent data and doubles cost.\n3. Backup-and-restore to a new region — lowest cost; RTO measured in hours and RPO in the backup interval.\n4. Pilot light (data replicated, compute provisioned on demand) — cheaper than warm standby; RTO depends on provisioning time."
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"relations": []
|
|
60
|
+
}
|