द्वैधलेखनधर्मः। भूमार्गे (२९ अक्टो) पथः। अत्र द्वौ भण्डारौ एककार्ये कथं भिद्येते। dual write, outbox, reconcile। न आशा-2PC; द्वैधलेखनधर्मः

English (minimizable)

After geo routing (29 Oct), this post covers dual writes: partial failure, fake 2PC, single source of record, outbox alternatives, forced-window guards, reconciliation, migration-only dual periods and how CDC or event logs differ.

पूर्ण-शीर्षकम् / Full title

द्वैधलेखनधर्मः: A Metrical Codification of Dual Writes (with English glosses)

English · overview and topics (minimizable)

What this post is about

Dual writes attempt two independent durable updates in one business action without a shared commit. They are a common source of silent split truth.

Topics covered

  1. Why dual write diverges
  2. Partial success ghosts
  3. No fake distributed TX
  4. One system of record
  5. Outbox or log then project
  6. Idempotency if temporarily forced
  7. Continuous reconciliation
  8. Short migration windows only
  9. Search and cache as derived
  10. Contrast with CDC and event sourcing

Sanskrit title

द्वैधलेखनधर्मः = dvaidha-lekhana-dharmaḥ “dharma of twofold writing”.

English

Minimizable; Sanskrit-first.

परम्परा-सन्धिः / Series links
पूर्वं / Prior अत्र / Adds न पुनः / Does not repeat
बहिर्लेखनपटलः (२८ सितम्बे) outbox preferred birth pattern
परिवर्तनप्रवाहः (१३ अक्टो) CDC one source many sinks
घटनास्रोतधर्मः (२५ अक्टो) event log ordered single stream
इदमर्थकुञ्चिका (४ अक्टो) idempotency forced dual retries
इदम् dual-write risks guards -
ग्राह्य-त्याज्य-विवेकः / Keep and avoid

ग्राह्यम् / Keep

१. one system of record: always preferred
२. project via outbox/log: not dual sync APIs
३. idempotency both sides: if forced
४. reconcile continuously: detect drift
५. migration dual window: time-boxed
६. search/cache derived: never twin primary
७. page on unrepaired drift: not silent hope

त्याज्यम् / Avoid

  • two sync writes in one request as permanent design
  • assume SaaS joins your 2PC
  • skip reconcile because it usually works
अध्याय-योजना / Chapter plan
प्रकरणम् विषयः छन्दः श्लोकाः
मङ्गलं बीजं च / Opening अनुष्टुभ्
मूलतत्त्वानि / Core अनुष्टुभ्
मुख्यविधिः / Method उपजाति
रक्षा · विधिः / Guards अनुष्टुभ्
विवेक · सीमा / Judgment अनुष्टुभ्
पूर्वसन्धिः / Series links उपजाति
उपसंहारः / Close अनुष्टुभ्
पारिभाषिक-कोशः / Glossary
Modern English संस्कृतम् Note
dual write द्वैधलेखनम्  
system of record प्रामाणिकस्रोतः  
outbox बहिर्लेखनपटलः  
reconciliation समन्वयनम् / reconcile  
drift विचलनम्  
2PC / XA द्विचरणप्रतिज्ञा  
projection प्रक्षेपणम्  
cutover छेदकालः  
ghost write भूतलेखनम् half success
idempotency key इदमर्थकुञ्चिका  

श्लोकः १ (अनुष्टुभ्)

एककार्यं द्वयोः भण्डारयोः यदि युगपद् लिख्यते ।
द्वैधलेखनधर्मस्तस्माद् विसंवादाभयम् ॥१॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
एककार्यं द्वयोः भण्डारयोः यदि युगपद् लिख्यते । द्वैधलेखनधर्मस्तस्माद् विसंवादाभयम् ॥१॥

Word-for-word

संस्कृतपदम् Word-for-word English
एककार्यम् one job
द्वयोः of two
भण्डारयोः stores
युगपत् at once
लिख्यते is written
द्वैधलेखनधर्मः dual-write dharma
विसंवादाभयम् disagreement fear

Gloss table

पदम् अर्थः / sense
द्वैधलेखनधर्मः dual-write dharma
विसंवादाभयम् divergence risk

English sense
Dual writes update two systems in one business action without a shared transaction. Partial success creates permanent divergence.

Context / topic
Topic: why dual write is dangerous. Distinct from intentional CDC fan-out from one log.

वृत्तमिति: ८-८-८-८।

श्लोकः २ (अनुष्टुभ्)

A ok B fail = ghost truth ।
retry blindly द्विगुणदोषः ॥२॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
A ok B fail = ghost truth । retry blindly द्विगुणदोषः ॥२॥

Word-for-word

संस्कृतपदम् Word-for-word English
A A
ok ok
B fail
fail fail
ghost ghost
truth truth
retry retry
blindly blindly
द्विगुणदोषः double fault

Gloss table

पदम् अर्थः / sense
ghost truth one side only
retry blindly duplicate other side

English sense
When the second write fails you have a half-applied fact. Blind retries can double-apply the side that already succeeded.

Context / topic
Topic: partial failure.

वृत्तमिति: ८-८-८-८।

श्लोकः ३ (अनुष्टुभ्)

no distributed TX across alien stores ।
hope-2PC मिथ्या ॥३॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
no distributed TX across alien stores । hope-2PC मिथ्या ॥३॥

Word-for-word

संस्कृतपदम् Word-for-word English
no no
distributed distributed
TX TX
alien alien
stores stores
hope-2PC hope two-phase
मिथ्या false

Gloss table

पदम् अर्थः / sense
alien stores heterogeneous systems
hope-2PC pretend XA everywhere

English sense
Most SaaS and search indexes do not join your database two-phase commit. Do not pretend they do.

Context / topic
Topic: no fake 2PC.

वृत्तमिति: ८-८-८-८।

श्लोकः ४ (अनुष्टुभ्)

single source + derived project ।
dual primary writes त्याज्यम् ॥४॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
single source + derived project । dual primary writes त्याज्यम् ॥४॥

Word-for-word

संस्कृतपदम् Word-for-word English
single single
source source
derived derived
project project
dual dual
primary primary
writes writes
त्याज्यम् to be avoided

Gloss table

पदम् अर्थः / sense
single source one system of record
derived project async build

English sense
Write once to the system of record and project outward. Two equal primaries are dual write by another name.

Context / topic
Topic: one writer of truth.

वृत्तमिति: ८-८-८-८।

श्लोकः ५ (उपजाति)

outbox then consumer
एकजन्म ।
direct dual API
युद्धाय ॥५॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
outbox then consumer एकजन्म । direct dual API युद्धाय ॥५॥

Word-for-word

संस्कृतपदम् Word-for-word English
outbox outbox
consumer consumer
एकजन्म one birth
direct direct
dual dual
API API
युद्धाय for war

Gloss table

पदम् अर्थः / sense
outbox then consumer atomic birth + async
direct dual API two sync calls

English sense
Prefer transactional outbox or change log then async consumers over two synchronous API writes in the request path.

Context / topic
Topic: outbox alternative.

वृत्तमिति: एकादशाक्षराः पादाः।

श्लोकः ६ (अनुष्टुभ्)

idempotency keys on both sides if forced ।
अकुञ्चिकं द्वैधं अन्धम् ॥६॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
idempotency keys on both sides if forced । अकुञ्चिकं द्वैधं अन्धम् ॥६॥

Word-for-word

संस्कृतपदम् Word-for-word English
idempotency idempotency
keys keys
both both
sides sides
forced forced
अकुञ्चिकम् keyless
द्वैधम् dual
अन्धम् blind

Gloss table

पदम् अर्थः / sense
idempotency keys safe retry
अकुञ्चिकम् without keys

English sense
If dual write is temporarily forced, give every side a stable idempotency key and a reconcile job.

Context / topic
Topic: forced dual write guards.

वृत्तमिति: ८-८-८-८।

श्लोकः ७ (अनुष्टुभ्)

reconcile job compares checksums ।
drift silent प्रेतः ॥७॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
reconcile job compares checksums । drift silent प्रेतः ॥७॥

Word-for-word

संस्कृतपदम् Word-for-word English
reconcile reconcile
job job
checksums checksums
drift drift
silent silent
प्रेतः ghost

Gloss table

पदम् अर्थः / sense
reconcile job periodic compare
drift silent unwatched divergence

English sense
Run continuous reconciliation that repairs or pages on drift. Unwatched dual stores diverge quietly.

Context / topic
Topic: reconciliation.

वृत्तमिति: ८-८-८-८।

श्लोकः ८ (अनुष्टुभ्)

migration dual-write window short ।
forever dual ऋणम् ॥८॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
migration dual-write window short । forever dual ऋणम् ॥८॥

Word-for-word

संस्कृतपदम् Word-for-word English
migration migration
dual-write dual-write
window window
short short
forever forever
dual dual
ऋणम् debt

Gloss table

पदम् अर्थः / sense
migration window cutover dual period
forever dual permanent anti-pattern

English sense
A short dual-write cutover for migration can be planned. Permanent dual write is unpaid architectural debt.

Context / topic
Topic: migration only.

वृत्तमिति: ८-८-८-८।

श्लोकः ९ (अनुष्टुभ्)

search cache analytics = derived not twin primary ।
index write beside DB dual ॥९॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
search cache analytics = derived not twin primary । index write beside DB dual ॥९॥

Word-for-word

संस्कृतपदम् Word-for-word English
search search
cache cache
analytics analytics
derived derived
twin twin
primary primary
index index
write write
beside beside
DB DB
dual dual

Gloss table

पदम् अर्थः / sense
derived not twin projections
index write beside DB classic dual

English sense
Search indexes and caches should follow the log or outbox. Writing them in the same request as the DB is dual write.

Context / topic
Topic: search and cache.

वृत्तमिति: ८-८-८-८।

श्लोकः १० (उपजाति)

CDC एकश्रुतिः बहूपयोगः
द्वैधं द्वौ लेखनौ ।
घटनास्रोतः
एकपङ्क्तिः ॥१०॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
CDC एकश्रुतिः बहूपयोगः द्वैधं द्वौ लेखनौ । घटनास्रोतः एकपङ्क्तिः ॥१०॥

Word-for-word

संस्कृतपदम् Word-for-word English
CDC CDC
एकश्रुतिः one hearing
बहूपयोगः many uses
द्वैधम् dual
द्वौ two
लेखनौ writes
घटनास्रोतः event source
एकपङ्क्तिः one log

Gloss table

पदम् अर्थः / sense
CDC one DB many sinks
घटनास्रोतः one event log

English sense
CDC and event logs fan out from one ordered source. Dual write invents two independent sources in one action.

Context / topic
Topic: series distinctions.

सन्धिः: CDC/ES एकस्रोतः; द्वैध द्विस्रोतः

वृत्तमिति: एकादशाक्षराः पादाः।

श्लोकः ११ (अनुष्टुभ्)

one-source outbox idempotency reconcile short-window पञ्चकम् ।
एभिर्द्वैधलेखनधर्मो विसंवादभयसमन्वितः ॥११॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
one-source outbox idempotency reconcile short-window पञ्चकम् । एभिर्द्वैधलेखनधर्मो विसंवादभयसमन्वितः ॥११॥

Word-for-word

संस्कृतपदम् Word-for-word English
one-source one-source
outbox outbox
idempotency idempotency
reconcile reconcile
short-window short-window
पञ्चकम् five-set

Gloss table

पदम् अर्थः / sense
पञ्चकम् one-source outbox idempotency reconcile short-window

English sense
Five limbs: one system of record, outbox or log projection, keys if forced, continuous reconcile and short migration windows only.

Context / topic
Topic: checklist.

वृत्तमिति: ८-८-८-८।

श्लोकः १२ (अनुष्टुभ्)

इति द्वैधलेखनधर्मसारो विसंवादभयसमन्वितः ।
मितमेकलेखनं क्रियायोग्यं तन्त्रधर्मः स उच्यते ॥१२॥
पदच्छेदः · Word-for-word · English (minimizable)

पदच्छेदः
इति द्वैधलेखनधर्मसारो विसंवादभयसमन्वितः । मितमेकलेखनं क्रियायोग्यं तन्त्रधर्मः स उच्यते ॥१२॥

Word-for-word

संस्कृतपदम् Word-for-word English
इति thus
द्वैधलेखनधर्मसारः dual-write essence
विसंवादभयम् divergence fear
मितम् measured
एकलेखनम् single writing
क्रियायोग्यम् operable
तन्त्रधर्मः system dharma

Gloss table

पदम् अर्थः / sense
मितमेकलेखनम् measured single write
तन्त्रधर्मः platform dharma

English sense
Closing: write once, project many times and never leave two primaries unreconciled.

Context / topic
Topic: close.

उपसंहारन्यायः: एकं लिख; बहु प्रक्षिप; द्वौ मा युगपत् प्राथम्येन।

वृत्तमिति: ८-८-८-८।

श्लोकसूची / Verse index

१. Why dual write
२. Partial fail
३. No 2PC
४. One source
५. Outbox
६. Keys if forced
७. Reconcile
८. Migration window
९. Derived indexes
१०. CDC/ES
११. Five limbs
१२. Close

सन्दर्भाः / References
  1. Prior: outbox 2026-09-28; CDC 2026-10-13; event sourcing 2026-10-25; idempotency 2026-10-04.
  2. Domain: dual-write anti-pattern and guards.
  3. English minimizable; Sanskrit-first.
  4. Style: no em dash; no Oxford comma in English clauses.