We Built a Mobile Document Library With No Database
By the Paperora teamPaperora's document library uses the filesystem instead of a database. Scans are files, folders are directories, per-document data rides along as sidecar files, and tags and favourites live in SharedPreferences keyed by path. There is no SQLite, which keeps the app simple at the cost of indexed queries.
Key takeaways
- The library is the filesystem: every scan is a real file and every folder a real directory, with no separate document table.
- Per-document extras, like a page's text layer, are stored as sidecar files that move with the document.
- Tags, favourites and the selected tag live in SharedPreferences, keyed by file path.
- The trade-off is no indexed queries and a path-keyed index that needs care when files move.
Most apps that manage a list of things reach for SQLite, or a wrapper over it like Drift, Isar or Hive. Paperora is an Android document scanner with a library of scans, folders, tags and favourites, which sounds like exactly the job a local database is for. We do not use one. The scans themselves are the database.

How it works
- The library is the filesystem. Every scan is a real file under the app's documents directory, and every folder is a real directory. There is no separate table of documents. Listing a folder is reading that directory and reading each file's own metadata: name, size and modified date come straight from the file.
- Per-document extras ride along as sidecar files. When a page carries editor data, such as the text layer behind a scan, it is written as a sidecar next to the document. Move the document and the code moves its sidecars with it, so the two never drift apart.
- The small index lives in SharedPreferences, keyed by path. The things that are not a property of the file itself, like tags, favourites and the selected tag, are stored in SharedPreferences. Favourites, for example, are just a list of file paths.
So there is no schema, no migrations and no query layer. The source of truth is the set of files on disk, and a thin layer of preferences points into it.
Why we did it this way
- The files are the thing. A scanner's whole job is to produce files the user owns. If those files are the library, there is nothing to keep in sync with them and nothing to corrupt separately. Delete a file and it is gone from the library too, because the library was never a second copy of the truth.
- Backup is trivial. Optional Google Drive backup is copying files, not exporting and re-importing a database.
- Less to ship and less to break. No database dependency, no migration code to get wrong on an upgrade, and one less thing adding to the install.
The catch, honestly
This is not free. The trade-offs are real and worth knowing before you copy it.
- Listing is a directory walk plus a stat per file. For a normal library this is fast, but it does not have the indexed query performance a database gives you. With tens of thousands of documents in one folder, a database would start to win.
- A path-keyed index is fragile when files move. Because favourites and tags are keyed by path, moving or renaming a document can orphan them if you are not careful. That is exactly why moving a document also relocates its sidecars, and why the path handling has to be careful about normalisation and nested folders. A database with stable row IDs would sidestep this.
- No rich queries. Anything like "every document tagged work, sorted by size, across all folders" is code you write over the filesystem, not a query you hand to a database.
Would we do it again
For a document scanner, yes. The data model really is files and folders, so making the filesystem the library keeps the app simple and the user in control of their own documents. The moment the data stopped being files, say a heavy relational model with lots of cross-references and queries, we would switch to a database without hesitation. The honest rule is to match the store to the shape of the data, and for a scanner the data is files.
Related reading
For the product side, see the document scanner guide and the offline, local-storage scanner. For the size and startup numbers from the same app, read what an offline Android scanner actually weighs.
Frequently asked questions
- Can a mobile app manage documents without a database?
- Yes. Paperora stores its library on the filesystem: scans are files, folders are directories, and metadata like name and size is read from each file. A small index of tags and favourites lives in SharedPreferences keyed by path. There is no SQLite.
- Why not use SQLite for a document library?
- When the data is already files, a database becomes a second copy to keep in sync. Using the filesystem directly means nothing can drift out of sync, backup is just copying files, and there is no migration code to break. The cost is no indexed queries and no rich filtering.
- What are the downsides of a filesystem-first library?
- Listing means walking directories and reading each file, which is fine for a normal library but slower than an indexed query at very large scale. And because tags and favourites are keyed by file path, moving or renaming files needs care so the index does not orphan.