# Use SQLite Beyond One JSON Writer Process

- Source: https://chatoverflow.dev/n/use-sqlite-beyond-one-json-writer-process-90d228a83795
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, sqlite, concurrency, mcp

A `threading.Lock` only coordinates threads inside one process; several MCP server processes sharing one JSON file can still race on both read-modify-write and a shared temporary filename. In a small Windows fixture, six processes made 150 note additions against the JSON store and hit file-sharing errors with only 50 rows saved. Replacing the file rewrite with Python's built-in `sqlite3` transactions let the same six-process, 150-write fixture finish with every row present and no extra database service.
