Introduction to Engula

Engula is a high-performance, memory-efficient Redis-compatible kernel. Built on the Redis Server codebase, it replaces Redis's in-memory object store with the Engula Memory Engine while preserving protocol and behavioral compatibility, allowing existing Redis deployments to migrate and validate at lower cost.

Core Design Philosophy

Engula's architecture follows three core principles:

  • High Redis behavioral consistency: Official runtest and client validation are continuously published, keeping migration cost extremely low
  • Memory efficiency first: Reduces footprint through compression and compact metadata encoding
  • Latency as a priority: Under typical read/write workloads, foreground-request P99 latency is on par with Redis 7.2 measured under the same conditions (sub-millisecond)

Architecture Overview

Engula Server retains the overall architecture of Redis Server, with the primary change being the replacement of the in-memory object store with the Engula Memory Engine. Other modules require only minor adaptation, preserving existing Redis functionality while maintaining compatibility.

Memory Representation

In Redis Server, data access revolves around the Redis Object (robj).

In Engula Server, in-memory data is represented as an Engula Object (eobj): a more compact structure specifically optimized for compression/decompression efficiency.

During key-value operations, Engula converts an eobj into a temporary robj on demand:

  • Lazy loading: A temporary robj is created only when needed
  • Automatic release: Compiler-level guarantees ensure temporary objects are correctly reclaimed across all code paths

Memory Efficiency

Engula significantly reduces memory overhead through highly optimized data structures and encoding. In a typical scenario:

Data Structure Redis Metadata Overhead (bytes) Engula Metadata Overhead (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% metadata overhead reduction

Note: The table above compares per-key internal metadata overhead (excluding the value data itself). The larger the values, the smaller the contribution of metadata savings to total memory; the smaller the values and the more keys, the closer the overall saving rate gets to the table above. Measured total memory savings on typical workloads are 40%–75% — import your own RDB with ValueSight for an accurate estimate.

Memory Block Management

Engula stores key-value data in Memory Blocks, divided into:

  • Mutable Zone: A data region that can be modified
  • Immutable Zone: A data region where only deletion is allowed

Background tasks periodically compact and replace the blocks in the Immutable Zone. These background tasks are broken down into fine-grained, interruptible coroutines and executed within the native Redis main thread and I/O threads.

Engula dynamically adjusts the response time budget based on system load, prioritizing the latency targets of foreground requests; background work is distributed according to the utilization of each I/O thread to improve overall CPU efficiency.

Performance and Scalability

Horizontal Scaling

Engula supports near-linear horizontal scaling by adding I/O threads. Overall throughput can match or exceed Redis while maintaining more predictable CPU scalability.

I/O Model Optimization

Redis (Busy Polling Model)

  • Philosophy: Exclusively occupies CPU and memory resources by default
  • Mechanism: I/O threads first busy poll (≈ 1 million cycles ≈ 0.1ms) before going to sleep
  • Behavior: CPU consumption grows non-linearly under high load

Engula (Adaptive Signal/Wait Model)

  • Philosophy: Resource efficiency for shared environments
  • Mechanism: Replaces busy polling with signal/wait implemented via atomic operations and pthread condition variables
  • Optimization: Reduces signal frequency and minimizes redundant context switches
  • Result: Achieves Redis-level peak throughput while delivering smoother, more predictable CPU scaling

CPU–Memory Trade-off

Through real-time compression/decompression, Engula trades controlled CPU overhead for significant memory savings, lowering overall memory cost while maintaining performance.

Redis® and Valkey Compatibility

Engula maintains high wire-protocol consistency with Redis and Valkey. By reusing the native compute layer of these ecosystems, Engula delivers consistent behavior for standard data operation commands; the reasons and impacts of known differences are published in proof-live.

With a modular design that highly isolates storage integration points, Engula can align with new Redis/Valkey version releases within one month, ensuring a steady pace of compatibility updates.

Version Support

  • Redis: 7.2.11 is the current publicly validated baseline
  • Valkey: Full version support
  • Continuous evolution: Migration to Valkey 8/9 is underway

Enhanced Features

Performance Enhancements

  • Private RDB format: Shortens SAVE/LOAD time and accelerates full replication sync
  • Large Value optimization: In multi-threaded (≥ 4 threads) configurations, large value read performance improves by more than 50%

Functional Enhancements

  • ZSet compression: Compresses sorted sets to further reduce memory overhead
  • Enhanced threading model: A per-thread/per-coroutine scheduling and priority system that improves CPU utilization and tail-latency performance

Summary

Engula combines innovative memory management, strong compression strategies, and protocol-level interoperability to deliver significant improvements for Redis-compatible databases.

Its adaptive I/O model and horizontally scalable architecture provide more stable, more linear performance, achieving a 40%–75% lower memory footprint (measured on typical workloads; varies with data structures and value sizes) without sacrificing compatibility—ideal for production scenarios that aim to lower memory cost while demanding the highest levels of stability.

License and Editions

Engula offers two editions:

  • Engula Developer Edition — Free forever, up to 6 Engula nodes (any master/replica ratio), with no per-instance memory limit.
  • Engula Enterprise — For larger scale and production use, including enterprise support, SLA, and a formal contract.

For full edition differences and EULA details, see the License and EULA page. For larger scale or enterprise support, contact sales: sales@engula.com.