Fusing Database Transactions with Unmanaged Flash Memory Control
What is the Transactional Flash Translation Layer (TFTL™)?
TFTL is a component of eXtremeDB/rt for unmanaged (raw) flash memory devices, which lack a controller or Flash Translation Layer (FTL), requiring the host system to handle these operations. Within the database kernel, TFTL provides this functionality—ensuring ACID-compliant transactions, deterministic performance, and low overhead—while giving developers full control over media access to meet strict real-time requirements.
Under the hood of Transactional Flash Translation Layer
The Transactional Flash Translation Layer in eXtremeDB/rt enables database transactions directly on raw flash memory. It organizes pages in a rotating buffer and maintains an index structure for efficient access. Unlike conventional FTLs, TFTL avoids a full in-memory mapping of logical to physical pages, making it suitable for systems with limited resources.
When a page is updated, TFTL writes the new copy at the active position in the buffer and updates the index so the logical address always refers to the latest version. This process naturally distributes writes across blocks, ensuring balanced wear leveling. On commit, the latest pages are flagged; during rollback, TFTL locates the last commit and restores the index to ensure database consistency.
TFTL preserves full database ACID properties while managing essential flash memory mechanisms. A detailed description of its implementation is available in the official eXtremeDB/rt documentation and supporting technical materials.
In context
The Transactional Flash Translation Layer (TFTL) is necessary for real-time systems; traditional FTLs bury flash management tasks making it impossible to enforce deadlines. Conversely, TFTL gives the database kernel maximum control over all flash operations, enabling low-latency fully deterministic performance and hard real-time behavior—capabilities essential for mission-critical systems.
By contrast, when working with managed flash devices such as eMMC, UFS, or NVMe SSDs, the Transactional File Mapping (xFile™) module is often the better fit. xFile emphasizes seamless integration and ease of development, relying on the device’s internal controller for flash management while still ensuring safe database transactions.
All eXtremeDB/rt distributions include the Flash Simulator, which allows TFTL-based applications to be developed, tested, and evaluated without requiring physical flash hardware. The simulator can model flash timing characteristics and media faults, helping developers validate both functional behavior and real-time performance early in the development cycle.
Tests were run on an NXP RT1064 board running Zephyr OS with MX35LF4GE4AD flash memory and a convention FTL (no file system). Showed that I/O volume for read, program, erase, and copy operations was up to four times lower with TFTL (red) compared to xFile (black).
