Engula is a high-performance, memory-efficient database that is fully compatible with Redis. Built from Redis Server, Engula replaces Redis's in-memory object storage module with the Engula memory engine while maintaining complete protocol compatibility, enabling smooth migration from Redis.
Engula is designed with three core principles:
Engula Server is derived from Redis Server. The core transformation replaces Redis's in-memory object storage module with the Engula memory engine, while other Redis modules require only minimal adaptation, ensuring full compatibility with Redis.
In Redis Server, data access revolves around the Redis Object (robj). In Engula Server, when data is stored in memory, Redis Object is converted to Engula Object. Engula Object uses a more compact memory layout and is better adapted for compression/decompression operations.
When Redis performs KV operations, Engula Object is converted to a temporary Redis Object through:
Engula significantly reduces memory usage through optimized data structures and encoding:
| Data Structure | Redis (bytes) | Engula (bytes) | Optimization |
|---|---|---|---|
| HashTable | 32 (dictEntry) | 14 | Swiss table |
| Key + robj | 3 (key sds) + 16 (robj) | 10 | eobj storage |
| Value (String) | 3 (value sds) | 1 | eobj storage |
| TTL | 8 | 5 | Variable-length integer encoding |
| Jemalloc | ≥ 4 (8-byte alignment) | 2 | Memory Block management |
| Total | 66 | 32 | ~50% reduction |
KV data is organized into Memory Blocks, which are divided into:
Background tasks compress and replace Memory Blocks in the Immutable Zone. These background tasks are split into small, interruptible and resumable execution units that run as coroutines embedded in native Redis's main thread and IO thread contexts.
The system automatically adjusts expected response times based on load conditions and schedules foreground tasks before deadlines. Background tasks are automatically distributed across different IO threads based on thread busyness to maximize CPU resource utilization.
Engula enables horizontal scaling by adding IO threads, with system throughput approaching or exceeding Redis. The architecture supports linear CPU scalability and predictable performance characteristics.
Redis: Busy Polling-based latency optimization model
Engula: Adaptive Signal/Wait efficiency optimization model
Engula implements real-time data compression/decompression to reduce data redundancy, trading CPU cycles for memory efficiency. This design significantly reduces memory usage while maintaining high performance.
Engula maintains full compatibility with Redis and Valkey protocols. By integrating the native compute layers of Open Source Redis and Valkey into its solution, Engula achieves protocol compatibility for data manipulation commands through careful identification of minimal storage integration points.
Engula can adapt and achieve protocol alignment within one month of new Redis or Valkey releases, ensuring seamless synchronization with the latest updates from both communities.
Engula represents a significant evolution of Redis, delivering substantial memory savings through innovative memory management and compression techniques while maintaining full protocol compatibility. Its adaptive I/O model and horizontal scaling capabilities provide predictable, linear performance characteristics that surpass traditional Redis deployments.
Through memory-efficient design, performance optimizations, and complete Redis/Valkey compatibility, Engula offers a compelling solution for organizations seeking to reduce memory costs without sacrificing performance or migration complexity.