SleekDB
activeby SleekDB contributors (RakibTG) · since 2018
Dependency-free PHP library that stores schemaless documents as plain JSON files on disk.
Overview
SleekDB is a flat-file document store written in pure PHP: each store is a directory, each document a JSON file, and a fluent query builder handles conditions on nested fields, sorting, simple joins between stores, text search and a built-in query result cache. It needs nothing but PHP, which makes it handy on shared hosting, for small CMS-like sites and for prototypes where running MySQL is overkill. The authors themselves aim it at low-to-medium load and a few gigabytes of data; queries scan files and there is no real concurrency control. Version 2.50 (November 2025) moved the library to PHP 8.4.
Strengths & trade-offs
Strengths
- +Only needs PHP: no server, extension or binary to install
- +Data stays human-readable JSON files you can inspect, copy and version
- +Query builder handles nested fields, sorting, joins and text search
- +Built-in query cache speeds up repeated reads
Trade-offs
- −Queries scan files, so performance falls off as stores grow
- −No transactions or robust multi-writer locking
- −PHP-only; other languages cannot share the data safely
- −Version 2.50 requires PHP 8.4, dropping older hosts
Great for
- +Small PHP websites on shared hosting
- +Prototypes and admin tools without a database server
- +Storing configuration or content as JSON documents
Think twice for
- −High-traffic or write-heavy applications
- −Datasets beyond a few gigabytes
- −Multi-language access to the same data
Capabilities
Native or official first-party support · 4 of 25 tracked
Scale & consistency
- Comfortable data size
- Small · ≤ 100 GB
- Horizontal scaling
- None
- Multi-region
- No
- Transactions
- None
- Consistency
- Strong
- Schema
- Schemaless
- Architecture
- Embedded
- Query languages
- PHP query builder
Designed for a few gigabytes of data and light concurrency.
Deployment
Ecosystem
Alternatives to SleekDB
The in-process SQL engine that ships in every phone, browser and OS: one file, zero servers.
sleekdb vs sqlite →Tiny type-safe local JSON database for Node, Electron and the browser using plain JavaScript.
sleekdb vs lowdb →Pure-JavaScript embedded datastore with a MongoDB-like API; the original is unmaintained.
sleekdb vs nedb →In-memory JavaScript document store with indexes and pluggable persistence; no longer maintained.
sleekdb vs lokijs →The default document database: flexible BSON documents, rich queries and built-in sharding.
sleekdb vs mongodb →Structured static database for game data: spreadsheet-style editor, typed sheets and diff-friendly JSON.
sleekdb vs castledb →SleekDB FAQ
What is SleekDB?
SleekDB is a document database by SleekDB contributors (RakibTG), first released in 2018. SleekDB is a flat-file document store written in pure PHP: each store is a directory, each document a JSON file, and a fluent query builder handles conditions on nested fields, sorting, simple joins between stores, text search and a built-in query result cache. It needs nothing but PHP, which makes it handy on shared hosting, for small CMS-like sites and for prototypes where running MySQL is overkill. The authors themselves aim it at low-to-medium load and a few gigabytes of data; queries scan files and there is no real concurrency control. Version 2.50 (November 2025) moved the library to PHP 8.4.
Is SleekDB open source?
Yes. SleekDB is open source. License: MIT License.
Does SleekDB support ACID transactions?
No. SleekDB does not provide ACID transactions; its consistency model is strong.
Does SleekDB scale horizontally?
SleekDB does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).
How can I run SleekDB?
You can self-host it and embed it in your application.
What is SleekDB best for?
SleekDB is a strong fit for small PHP websites on shared hosting; prototypes and admin tools without a database server; and storing configuration or content as JSON documents. Think twice for high-traffic or write-heavy applications.
What are the best alternatives to SleekDB?
Common alternatives to SleekDB include SQLite, lowdb, NeDB, LokiJS and MongoDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
How popular is SleekDB?
SleekDB ranks #467 of 844 databases on the WhichDB Score (2.7/100), and #41 among document databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.

