IBM Introduces Mapepire, The New Db2 For i Client
September 9, 2024 Alex Woodie
IBM has released a new client for connecting applications to the Db2 for i database. Dubbed Mapepire, the open source client is designed to be faster, lighter weight, and easier for developers to work with compared to existing ODBC and JDBC database clients, especially in cloud environments.
Building an application-side database client using existing Db2 for i’s database drivers, such as ODBC and JDBC (included in the JTOpen Java toolbox for IBM i) typically entails cramming a lot of overhead into the client component, says Liam Allan, who helps develop new open source development tooling at IBM.
“For example, jtopen and ODBC clients have code inside of them to deal with CCSIDs – converting string columns to and from certain encodings. This makes client very large in code but also in complexity,” Allan and his IBM colleagues, Adam Shedivy and Sanjula Ganepola, write in an August 30 blog post introducing Mapepire.
“Another ick that I’ve always had with ODBC and jtopen is that the protocol used to communicate between the server and clients is not publicly documented (or at least, very well),” the IBMers write. “So, if you want to create a new client in a new language you have to reverse engineer what is available – I tried it, it sucked.”
These are two of the big obstacles that Allan and company hope to remedy with Mapepire, which is the first new database driver or database client from IBM in a number of years. For starters, Mapepire, which is written in JavaScript and uses Secure WebSockets, is open source – that should eliminate any need to attempt to reverse engineer how the ODBC or JDBC drivers work.
The second big change – arguably the bigger change – is that Mapepire will push a lot of the complexity in establishing database connections from the language-specific client and onto the Mapepire server.
“We’re letting the server piece take care of things like encodings, password levels, and much more, which makes the clients lighter,” Allan and company write. “We’re going to make it easier for people to write new applications in more languages that can run on more platforms.”
Mapepire is “almost dumber” than ODBC clients since it “doesn’t manage anything to do with encodings, passwords, and other stuff that is rammed in jtopen/jt400,” Allan writes.
One of the goals of Mapepire is to enable developers to use a single client-side software development kit (SDK) across multiple languages, according to the Mapepire documentation on GitHub. It will also eliminate native dependencies on the client side, while minimizing dependencies in general. Communication with the database will be done through a single port, and the data is always encrypted.
Mapepire is also designed to be easier to deploy in cloud environments. IBM says it will run “seamlessly” in Red Hat UBI (universal base image) deployments, Alpine Linux containers, and the magnitude of cloud services available (like IBM Cloud, IBM WatsonX.ai, Vercel, AWS, or Azure).
Another benefit: Mapepire will also be distributed via Yum and use the typical registries for different languages. That means the Node.js client will be posted to npm, the Python client will be on PyPi (The Python Package Index), and the Java client will be on Apache Maven. “This means we can ship updates and fixes to you faster than before,” the IBMers write.
So, just how fast is Mapepire? To test the throughput, Allan pitted Mapepire-js against an ODBC client for Node.js and found the Mapepire client was significantly faster using a number of different configurations. You can read more about his tests here.
Currently, there are Mapepire clients for Python, Node.js, and Java, but that will likely be expanded in the future as the community of open source IBM i developers learns about Mapepire and starts to experiment with it. The IBMers have identified C#/.NET Core, PHP, and Go as potential targets for additional clients.
Mapepire clients and sample applications can be downloaded at the GitHub project website, mapepire-ibmi.github.io/.
By the way, Mapepire is a type of pit viper found in South America. The logo for Mapepire is arguably the greatest to come out of Big Blue since the original IBM logo. As for how to say it, the IBMers say the proper pronunciation is “MAH-pup-ee,” but other sites on the Web have different pronunciations. Perhaps we should just call it “fast.”
RELATED STORIES
What’s Cooking In Code For IBM i?
For the moment, the project pages in github say the documentation is in the repository and the linked page in the repository sends to the project page, so… no reference documentation.
There’s some sample executing a query and a CL. OK, that’s good. I also had that with previous drivers. I want to know…
– Can I upload and retrieve LOBS (CLOBS, BLOBS)? It’s just part of the payload, it needs some different treatment?
– Can I have the queries executed in the same connection instance? How are transactions achieved?
– There’s some API equivalent to cursors or some way to read massive amounts of data in a stream-like way?
Don’t get me wrong. It’s interesting. It would allow me to work against IBMi DB from my local development machine (and I need that, vite doesn’t even install in IBMi), idb-connector, that it’s the one that works better for now, doesn’t allow it; sure is easier to install than the ones that are a wrapper around the closed ODBC driver (odbc itself, ibm-db); and the protocol being open is a great addition, maybe it opens the path for having support added to existing ORMs (that ignore IBMi DB2). It’s great news.