pastello-app

0010. File-based storage, trash and backup

Context

A child must never lose a drawing: not because of a crash, a dead battery, an accidental delete or a broken tablet. At the same time drawings must stay private and on the device. The number of drawings is small (tens to hundreds).

Decision

Drawings are stored as plain files in the app’s private storage, without a database:

<app documents>/
├── trash/               # deleted drawings, same layout, with deletion date
└── drawings/
    └── <uuid>/
        ├── drawing.json     # the document, with schemaVersion
        ├── history.json     # undo/redo history
        ├── thumbnail.png    # gallery thumbnail
        └── fills/           # bucket fill masks (after v1)

Consequences

Alternatives considered