April 25, 2025
By Benedetto Proietti
Redis,
Mainframe Modernization,
Enterprise Caching
“Wait… Redis? On z/OS?” If that was your reaction, you're not alone.
But before you scroll somewhere else, please note the policy that my client has:
No X86 in the building.
Oh boy. OK, I said. I don’t even want to know why.
At first glance, porting an in-memory, high-performance caching system like Redis to a mainframe OS might seem like forcing a round peg into a square hole. Redis is known for its lightweight footprint, lightning-fast response times, and deep integration with modern stacks—Node.js, Python, containerized microservices. Meanwhile, z/OS is a platform synonymous with decades-old batch processing, COBOL applications, and regulated enterprise workloads.
But scratch the surface, and the ask isn’t so weird after all. In fact, it’s a compelling idea—especially for organizations modernizing their mainframe infrastructure or building hybrid systems. Redis on z/OS isn't just a science experiment. It could be a way to bring familiar, modern tooling closer to where the data lives, reduce operational complexity, and even bridge generational skill gaps.
In this blog series, we’ll explore what it would take to port Redis to z/OS. We’ll dive into the gritty systems-level challenges, architectural differences, and the potential ROI. But first, let’s unpack why this effort matters in the first place.
Running Redis natively on z/OS may seem counterintuitive—until you consider what modern mainframe workloads actually look like.
Today’s enterprises don’t treat mainframes as isolated silos anymore. They’re deeply embedded into hybrid architectures where z/OS systems coexist with cloud-native microservices, distributed databases, and REST APIs. In this context, Redis becomes a natural fit: an ultra-fast, lightweight cache or message broker to serve the needs of web apps, fraud detection engines, or data pipelines—all of which may already interface with the mainframe.
By running Redis natively on z/OS, you can bring these capabilities closer to the data without the overhead of off-platform integration. It reduces latency, simplifies security policies, and avoids network chokepoints.
Let’s not underestimate the power of developer happiness. Many modern devs—especially those new to z/OS—are far more comfortable using tools like Redis, Git, or Node.js than navigating ISPF panels or writing JCL. Native Redis support (or any open-source tooling) makes the mainframe more welcoming and productive for hybrid teams.
This isn’t uncharted territory. HostBridge Technology has already introduced Redis for z/OS in 2015. HostBridge has been acquired by Broadcom in 2022 and that version of Redis is no longer available. I tried to reach out to Broadcom but got no reply so far.
IBM has also published Redis container builds for z/Linux systems. But it is not proper z/OS and doesn’t fit my client’s requirements.
Next, let’s talk about what makes this port hard—and why that’s part of the fun.
Redis itself is highly portable, written in ANSI C with relatively few hard dependencies, but it’s grounded in real use cases, real precedents, and real technical potential.
Porting Redis to z/OS presents a unique mix of low-level and architectural challenges that range from string encodings to process model mismatches. Here’s what’s on the table:
Redis is built for environments where memory allocation is fast, predictable, and cheap—typically Linux systems using malloc, mmap(), or custom allocators. z/OS, on the other hand, introduces different virtual memory models and storage management policies, especially when running under the Language Environment (LE).
You’ll need to revalidate all assumptions about address spaces, heap behavior, and possibly even consider segment boundaries. Memory pooling techniques may need to be re-implemented to avoid fragmentation or allocation failures.
One of Redis’s core features is its snapshotting mechanism for persistence, which relies on the fork() system call. This creates a copy-on-write clone of the process to safely write an RDB file without blocking the main thread. But fork() on z/OS USS is either limited or costly—and in many contexts, discouraged altogether.
A workaround may involve replacing fork() with a cooperative threading or multi-process model that emulates snapshot behavior, possibly leveraging z/OS’s own background job handling capabilities.
Janea has extensive understanding and experience on the “fork problem” since we tackled and solved this for Memurai on Windows many years ago.
Redis, like most open-source software, assumes the world speaks ASCII. But z/OS natively uses EBCDIC. That breaks everything from command parsing (“SET mykey myvalue”) to AOF and RDB file encoding. Even subtle issues—like comparing byte arrays—can lead to disastrous bugs.
Every point where a string is stored, parsed, serialized, or compared needs to be reviewed. You’ll likely need transparent translation layers or enforce ASCII zones within memory.
Redis reads and writes to the file system using familiar POSIX interfaces and expects a Linux-style path structure (/var/lib/redis). z/OS USS supports POSIX, but under the hood, it behaves differently—especially when it comes to file locking, permissions, and sync guarantees (fsync).
Persistent storage layers in Redis may need to be refactored to respect USS quirks or replaced entirely with dataset-based I/O if working outside USS.
Again, Janea can leverage its experience with porting Redis to Windows on this issue as well.
Redis is a networked server at heart, relying on low-latency TCP sockets. While z/OS USS does support BSD-like sockets, differences still exist—like how TCP options are handled, or how socket readiness is polled (select, poll, or epoll).
Testing is essential here. Behavior that’s reliable on Linux may degrade or fail silently under z/OS without tight validation.
Another plus for Janea and its experience with porting Redis to Windows.
Redis builds cleanly on Linux with make and gcc, but on z/OS, you’re looking at XL C/C++, Open XL, or even cross-compilation from a Linux host.
Makefiles might assume GNU extensions, certain flags, or linker behaviors not present on z/OS. Some dependencies Redis uses (e.g., jemalloc) may not even be compiled without modifications.
IBM Z is big-endian. Redis assumes little-endian in many of its internal data formats, especially for RDB and protocol serialization. Without explicit endian handling, Redis on z/OS would generate data incompatible with Redis on every other platform.
This isn't just a performance footnote—it’s a compatibility landmine.
On Linux, Redis developers use gdb, strace, /proc, and a range of lightweight tools for diagnostics. On z/OS, you enter a different world: LE stack traces, SMF records, and USS logs.
Understanding how to trace a malloc corruption or a deadlocked socket without familiar tools is half the battle. Even logging assumptions (stdout, stderr) might need redirection or patching.
Memory management is one of the least visible yet most critical areas of Redis's performance. Redis thrives on predictable low-latency memory access patterns—it allocates, reallocates, and frees memory frequently, especially when dealing with variable-size data structures like hashes, lists, and sorted sets.
On Linux, Redis typically relies on malloc() (often from jemalloc), which in turn leverages the virtual memory system through brk() or mmap() behind the scenes. This model assumes:
Redis also benefits from memory overcommit settings and COW (copy-on-write) behaviors during fork(), which aren't guaranteed on z/OS.
z/OS introduces different assumptions:
jemalloc Portability: jemalloc may require significant changes to build and function correctly on z/OS. Alternative strategies include:
To make Redis run well on z/OS, memory assumptions must be challenged and re-engineered:
If done right, Redis can still be fast and efficient—even in an environment with a completely different philosophy around memory.
One of the hardest problems in porting Redis to z/OS lies in how Redis handles persistence. More specifically: its reliance on fork() to create background snapshots.
On Linux and other Unix-like systems, fork() is a well-understood primitive. It creates a copy-on-write duplicate of the current process. Redis uses this to write RDB snapshots or rewrite the AOF file without pausing command processing. It’s elegant, efficient—and tightly coupled to how Unix handles memory.
z/OS UNIX System Services (USS) does support fork(), but not always in the way Redis expects:
In short, even if fork() compiles and runs, the runtime characteristics are very different. Redis’s assumption of cheap, fast background snapshots doesn’t hold.
The Redis community has explored alternatives to fork() for years—especially for environments like embedded systems and Windows:
As briefly said above, Janea Systems has solved this problem with Memurai. And although Memurai is closed source, Janea Systems can surely leverage its knowledge should it attempt to port Redis to z/OS.
fork() is central to Redis’s persistence model, but it’s not sacred. With careful engineering, we can replace it on z/OS with a thread-based or helper-process model. This will require deep changes to Redis internals, but could ultimately yield a Redis that’s more portable, scalable, and cloud-friendly.
Porting Redis to z/OS is not a weekend hack. It’s a systems-level project with serious complexity. So why would anyone take it on?
Scenario | Redis on z/OS Advantage |
Fraud detection | Cache user behavior data next to CICS transaction state for real-time scoring. |
Session state | Store session tokens and user profiles for secure APIs or login flows. |
Hybrid cloud sync | Use Redis as a lightweight message or state buffer between z/OS and cloud-based systems. |
Response caching | Cache expensive or high-volume DB2 queries locally, reducing CPU and I/O load. |
In-memory analytics | Pre-aggregate data for batch reports or ad-hoc dashboards without impacting OLTP systems. |
While speculative, the ROI of Redis on z/OS could be significant across operational efficiency, developer productivity, and long-term platform strategy. It’s not just about porting a database. It’s about unlocking new patterns of performance, scale, and modernization—right where the enterprise’s most critical data already lives.
Porting Redis to z/OS is not for the faint of heart—but it’s far from impossible. If anything, it’s the kind of challenge that z/OS engineers were born to tackle: one that blends systems thinking, cross-platform understanding, and a bold vision for modernization.
We’ve laid out the rationale, dissected the technical hurdles, and explored the possible upside. From memory models to fork workarounds, from encoding mismatches to ROI scenarios—this journey is both technical and strategic.
Yes, Redis on z/OS would be a significant engineering lift. But it would also be a statement: that mainframes can evolve, integrate, and innovate right alongside modern distributed systems. It’s about redefining what belongs on z/OS—not by lowering standards, but by raising the ceiling of what’s possible.
This blog isn’t a blueprint. It’s an invitation. To experiment. To collaborate. To prototype. To question assumptions. Because great ideas often start as weird ones.
Redis on z/OS may not be mainstream—but every good idea starts out that way.
Are you also interested in having Redis in z/OS?
Ready to discuss your software engineering needs with our team of experts?