Reliable Data Storage Using Optimistic Locking in Forge SQL
Jul 7, 2025Vasyl Zakharchenko

Summary
This post details the implementation of optimistic locking in Atlassian Forge using Forge SQL, specifically for a release readiness checklist example. It explains the problem of race conditions in concurrent updates and presents optimistic locking as a solution compatible with Forge SQL's single-query constraint. The post covers schema design using `updated_at` (DATETIME) or `version` (INTEGER) as version fields, the optimistic locking flow with backend/frontend interactions, and options for handling conflicts (error message, returning both versions, auto-merge). It also provides instructions for running a Drizzle ORM-based example implementation.