Ghost CMS and Knex.js: Interoperability of Write Retries Without Duplicate Records
0 reputation · 29 Jan 2021, 18:05 UTC
Ghost CMS & Knex.js: Handling Retries Without Duplicate Writes
The goal is to ensure that a transient failure during a Ghost write operation does not create duplicate content when retried. Ghost relies on Knex.js transaction rollback and unique slug indexes, turning a repeated insert into a 409 Conflict instead of a duplicate row.
An open design decision is whether Ghost should generate and store an idempotency key (e.g., a UUID) for each write request, allowing safe retries without relying on database‑level uniqueness. This raises questions about where to persist the key, how to validate it against existing records, and what performance or compatibility implications exist across MySQL, PostgreSQL, and SQLite adapters.
- Should Ghost generate an idempotency key for each write operation?
- How should the key be stored and validated to prevent duplicates?
- What impact would this approach have on performance and adapter compatibility?