PHPackages                             araga/aux-data - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. araga/aux-data

ActiveLibrary[Database &amp; ORM](/categories/database)

araga/aux-data
==============

Lightweight, PSR-16 compliant key/value storage on top of SQLite using PDO. Perfect for CLI tools, configuration storage, and simple caching.

v1.0.0(6mo ago)017MITPHPPHP &gt;=8.1

Since Nov 14Pushed 6mo agoCompare

[ Source](https://github.com/araga-dev/aux-data)[ Packagist](https://packagist.org/packages/araga/aux-data)[ RSS](/packages/araga-aux-data/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

AuxData
=======

[](#auxdata)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://php.net/)[![PSR-16](https://camo.githubusercontent.com/00f5210acc87df7eecba4be303e2cd177b6b8c9305bd81b96c5f9d8ce8919619/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d2d31362d636f6d706c69616e742d627269676874677265656e2e737667)](https://www.php-fig.org/psr/psr-16/)

Small, dependency-free key/value storage on top of SQLite using PDO.

AuxData is designed for situations where you want a simple and persistent configuration or cache-like store without bringing a full cache system or database abstraction layer into your project.

Features
--------

[](#features)

- **PSR-16 SimpleCache compliant** - Standard interface for interoperability
- Lightweight: a single PHP class with minimal dependencies
- Uses SQLite via PDO with WAL mode for better concurrency
- Simple API: `set`, `get`, `has`, `delete`, `clear`
- PSR-16 batch operations: `setMultiple`, `getMultiple`, `deleteMultiple`
- Optional TTL (time-to-live) per key with `DateInterval` support
- Multiple databases and table names supported
- Atomic increment/decrement operations (safe for concurrent access)
- Transaction support for batch operations
- Garbage collection of expired keys
- Statistics and chunked iteration for large datasets
- Automatically creates the directory and SQLite file if needed

Requirements
------------

[](#requirements)

- PHP 8.1+
- PDO SQLite extension
- PSR-16 Simple Cache interface (`psr/simple-cache`)

When to Use
-----------

[](#when-to-use)

**✅ Perfect for:**

- CLI tools and scripts
- Single-user desktop applications
- Local configuration storage
- Development/testing caches
- Low to moderate traffic web applications
- Background job storage
- Simple session-like data
- Any project needing PSR-16 SimpleCache without external services

**❌ Not recommended for:**

- High-traffic APIs with heavy concurrent writes (use Redis/Memcached instead)
- Distributed systems requiring shared cache across multiple servers
- Applications needing sub-millisecond response times
- Systems with hundreds of concurrent write operations per second

**💡 Concurrency Notes:**

- SQLite with WAL mode handles multiple readers + one writer well
- Perfect for scenarios with read-heavy workloads
- `increment/decrement` operations are atomic and safe
- Multiple processes on the same machine can safely access the database
- For multi-server environments, use a network-based cache instead

Installation
------------

[](#installation)

```
composer require araga/aux-data
```

Basic Usage
-----------

[](#basic-usage)

```
