Download the PHP package orhanayd/nonedb without Composer
On this page you can find all versions of the php package orhanayd/nonedb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download orhanayd/nonedb
More information about orhanayd/nonedb
Files in orhanayd/nonedb
Package nonedb
Short Description File-based NoSQL database for PHP - No installation required
License MIT
Informations about the package nonedb
noneDB
noneDB is a lightweight, file-based NoSQL database for PHP. No installation required - just include and go!
Features
- Zero dependencies - single PHP file
- No database server required - just include and use
- O(1) key lookups - JSONL storage with byte-offset indexing
- Spatial indexing - R-tree for geospatial queries (v3.1)
- MongoDB-style operators -
$gt,$gte,$lt,$lte,$ne,$in,$nin,$exists,$like,$regex,$contains(v3.1) - Auto-sharding for large datasets (500K+ tested)
- Thread-safe - atomic file locking for concurrent access
- Method chaining - fluent query builder interface
Requirements
- PHP 7.4 or higher
- Write permission on database directory
Installation
Manual
Composer
Quick Start
Configuration
Create a .nonedb file in your project root:
Or programmatically:
Development mode (no config required):
See docs/CONFIGURATION.md for all options.
Query Builder
Available Operators
| Operator | Description | Example |
|---|---|---|
$gt |
Greater than | ['age' => ['$gt' => 18]] |
$gte |
Greater than or equal | ['price' => ['$gte' => 100]] |
$lt |
Less than | ['stock' => ['$lt' => 10]] |
$lte |
Less than or equal | ['rating' => ['$lte' => 5]] |
$ne |
Not equal | ['role' => ['$ne' => 'guest']] |
$in |
In array | ['category' => ['$in' => ['a', 'b']]] |
$nin |
Not in array | ['tag' => ['$nin' => ['spam']]] |
$exists |
Field exists | ['email' => ['$exists' => true]] |
$like |
Pattern match | ['name' => ['$like' => '^John']] |
$regex |
Regex match | ['email' => ['$regex' => '@gmail']] |
$contains |
Array/string contains | ['tags' => ['$contains' => 'featured']] |
See docs/QUERY.md for complete query reference.
Spatial Queries
See docs/SPATIAL.md for complete spatial reference.
Documentation
| Document | Description |
|---|---|
| docs/QUERY.md | Query builder, operators, filters |
| docs/SPATIAL.md | Geospatial indexing and queries |
| docs/CONFIGURATION.md | Configuration options |
| docs/API.md | Complete API reference |
Performance
| Operation | 10K Records | 100K Records |
|---|---|---|
| find(key) | 0.03 ms | 0.05 ms |
| find(filter) | 50 ms | 520 ms |
| insert (batch) | 290 ms | 3.1 s |
| count() | < 1 ms | < 1 ms |
| withinDistance | 10-20 ms | 50-100 ms |
Benchmarks on Apple Silicon. Key lookups are O(1) with byte-offset indexing.
Testing
Concurrent Access
noneDB uses atomic file locking (flock()) for thread-safe operations:
- No lost updates - concurrent writes are serialized
- Read consistency - reads wait for ongoing writes
- Crash safety - locks auto-release on process termination
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT License - see LICENSE file.
Author
Orhan Aydogdu
- Website: orhanaydogdu.com.tr
- GitHub: @orhanayd
"Hayatta en hakiki mürşit ilimdir."
"The truest guide in life is science."
— Mustafa Kemal Atatürk