When developers build local applications, they often default to installing full-blown database systems like PostgreSQL or MySQL. However, for a small business running a billing counter, administering a local SQL instance is a disaster waiting to happen. Services crash, configurations break, and data corruption goes unnoticed.
Why JSON-Based Storage?
For small to medium retail environments, a relational database server is overkill. At Apex Horizon, we designed a lightweight, append-only JSON database system. It keeps the simplicity of human-readable data format, has a zero memory footprint when idle, and can be backed up instantly by copying a single file. Reading data is as simple as parsing file text directly into memory at startup, allowing lightning-fast operations.
Solving the Reliability Equation
An offline database faces unique challenges, such as unexpected power cuts, system crashes, and manual user tampering. To ensure absolute data integrity, we implemented two-phase file commits:
- Atomic Writes: Data is first written to a temporary copy. Only when the write succeeds is the original file atomically replaced.
- Automatic Local Backups: The system automatically compresses database states into password-protected zip folders every time the application is closed.
Encryption at Rest
Since the database sits directly on the user's hard drive, physical security is paramount. All saved JSON files are encrypted using AES-256 GCM. The key is securely generated and held within the OS-native credentials vault, preventing malicious access to proprietary business logs even if the hard drive is extracted.

