Mapepire: A Modern Approach to Db2 for i

The IBM i community recently welcomed a new member to its open-source family: Mapepire. Named after a South American pit viper (pronounced MAH-pup-ee), this tool isn’t something to fear. In fact, it’s a venomous strike against the legacy headaches often associated with database connectivity. It addresses the complexities of traditional ODBC and JDBC drivers, offering a streamlined, secure, and cloud-friendly alternative.

Mapepire: A Modern Approach to Db2 for i

In this post, we’ll explore what Mapepire is, why it exists, and how you can get started with it today.

Table of Contents

What is Mapepire?

Mapepire is a modern database access layer built on top of Secure WebSockets. It serves as a bridge between modern application languages (like Node.js, Python, and Java with more coming, like potential support for .NET Core, PHP, and Go) and the Db2 for i database. Unlike traditional drivers, Mapepire moves the heavy lifting from the client to the server, providing a lightweight, fast, and highly portable way to interact with IBM i data.

The Mapepire server handles SQL execution natively on IBM i while clients send requests over a single encrypted port (default 8076). This architecture eliminates native driver dependencies on the client side and simplifies deployment in cloud-native and containerized environments.

Why was it developed?

IBM and contributors created Mapepire to overcome persistent pain points with traditional Db2 for i access methods. Existing ODBC drivers and the JDBC/JTOpen toolbox carry heavy complexity.Tx

These issues inflate client size, complicate maintenance, hinder cloud/container deployments and slow innovation.

Mapepire shifts that complexity to the server side. Developers gain a lighter, “almost dumber” client that focuses purely on sending queries and receiving results. The project delivers a consistent SDK across languages, supports deployment anywhere (Red Hat UBI, Alpine containers, IBM Cloud, WatsonX.ai, Vercel, AWS, Azure), uses a single port with always-encrypted traffic, minimizes dependencies, and enables faster updates through package managers (npm, PyPI, Maven).

Its primary purpose centers on empowering developers to build and deploy modern, cloud-native applications that access Db2 for i more easily, securely, and efficiently—without the baggage of legacy drivers.

Mapepire vs. JDBC and ODBC (src: mapepire-github)

IBM developed Mapepire to solve these “modern-day” problems, creating a driver that is container-ready and developer-friendly.

The Core Purpose and Benefits

Mapepire’s primary goal is to make IBM i data accessible anywhere. Whether you are running a microservice in an Alpine Linux container, a Jupyter notebook in WatsonX.ai, or a serverless function on AWS or Azure, Mapepire fits right in.

Key Benefits:

How to Install and Configure Mapepire on IBM i

Mapepire consists of two parts: the Server (running on IBM i) and the Client (running wherever your app is).

Install the Server

The easiest way to install the server is via Yum (Open Source Package Management). Open your SSH terminal and run:

mapepire installation

Using Open Source Package Management from ACS

Start the Server

You can start the server manually in an SSH session:

or via service commander

Note: The server defaults to port 8076. You can change this by setting the PORT environment variable before starting.

How to Use Mapepire

Once the server runs, you can use one of the language-specific SDKs. Let’s look at a Python example.

1. Install the Client SDK

2. Run a Query

3. Or Configure connection details in mapepire.ini:

4. Use the client in your Python script

Read More about Client Support: https://mapepire-ibmi.github.io/guides/clients/

5. TLS Configuration

Server certificate verification (ssl.CERT_REQUIRED) is enabled by default. To disable certificate verification, set the ignoreUnauthorized field to True in the connection details.

get the server certificate:

from mapepire_python.data_types import DaemonServer
from mapepire_python.ssl import get_certificate
creds = DaemonServer(host=server, port=port, user=user,password=password)

Limit Access to IBM i

Mapepire iprules.conf

Example:

Expected Outcome:

Result:

Python Samples

Here two of my basic python sample codes.

Sample 1: Get first 5 rows from a database/file

Output

Sample 2: Total User Profile Count, Enabled and Disabled User Profile Count, and Users who have *ALLOBJ and *SECADM.

Output

Is this fully secured?

Mapepire is a promising modern tool for IBM i SQL access over websockets, but like any technology, it comes with drawbacks and limitations that you need to consider, especially for app integration, security, and enterprise use.

Final Thoughts

Mapepire offers a modern, efficient, and secure approach to accessing Db2 for i. By simplifying client development and enhancing compatibility with cloud-native environments, it stands as a compelling alternative to traditional ODBC and JDBC drivers. For developers seeking a streamlined and flexible solution, Mapepire is worth exploring.