sleekdb

SleekDB is a simple flat file NoSQL like database implemented in PHP without any third-party dependencies that store data in plain JSON files. It is not designed to handle heavy-load IO operations, it is designed to have a simple solution where all we need a database for managing a few gigabytes of data. You can think of it as a database for low to medium operation loads.

sleekdb

The solution works great as the database engine for low to medium traffic websites. It makes simple database effortless. It caches all query data by default, in a way that would make any dynamic site as fast as static sites. It is also a flat file database, but instead of a single file it stores data in multiple JSON files.

That allows it to have a better concurrency support comparing to a FlatFile database system. It can be compared with other flat file database systems because the final query output will be cached and later reused from a single file instead of traversing all the available files.

Some features of SleekDB :

  • Lightweight, faster : Stores data in plain-text utilizing JSON format, no binary conversion needed to store or fetch the data. Default query cache layer.
  • Schema free data storage : SleekDB does not require any schema, so you can insert any types of data you want.
  • Query on nested properties : It supports schema free data, so you can filter and use conditions on nested properties of the JSON documents!
where( 'post.author.role', '=', 'admin' )

SleekDB will look for data at:

{
"post": {
  "author": {
    "role": "admin"
  }
}
}
  • Dependency free, only needs PHP to run : Supports PHP 7+. Requires no third-party plugins or software.
  • Default caching layer : SleekDB will serve data from cache by default and regenerate cache automatically! Query results will be cached and later reused from a single file instead of traversing all the available files.
  • Rich Conditions and Filters : Use multiple conditional comparisons, text search, sorting on multiple properties and nested properties. Some useful methods are:
    • where
    • orWhere
    • select
    • except
    • in
    • notIn
    • join
    • like
    • sort
    • skip
    • orderBy
    • update
    • limit
    • search
    • distinct
    • exists
    • first
    • delete
  • Process data on demand : SleekDB does not require any background process or network protocol in order to process data when you use it in a PHP project. All data for a query will be fetched at runtime within the same PHP process.
  • Easy to learn and implement : SleekDB provides a very simple elegant API to handle all of your data.
  • Easily import/export or backup data

SleekDB requires PHP >= 7.0 and ext-json installed. to install it simply run :

$ composer require rakibtg/sleekdb

Finally if you really have a very small load, maybe you will think about SQLite, but with SleekDB you could think about Database as embedded within your PHP application, even the data processing and fetching is done withing the same PHP processes.

More information at https://sleekdb.github.io/ Released under an MIT license.

LEAVE A REPLY

Please enter your comment!
Please enter your name here