What JSON on IBM i Can Do For You
October 14, 2015 Alex Woodie
IBM shipped a technology preview of the new JSON store earlier this year with updates to IBM i 7.1 and 7.2. Unfortunately, the JSON store did not move up to become a fully supported feature in the most recent Technology Refreshes unveiled by IBM last week, so native JSON support in DB2 for i will remain on the cutting edge for now. In any case, it’s clear that JSON is on the minds of IBM’s database developers, and therefore it should be on your radar too.
Eberhard, who wrote a developerWorks article called IBM DB2 for i: JSON Store Technology Preview (pdf), says one of the biggest advantages of using JSON in DB2 for i is the ability to share data across multiple systems.
As Eberhard mentioned, IBM is exposing an API that allows developers to access and manipulate the JSON data stored in the DB2 for i database. That is one way to work with JSON in DB2 for i–the other two being a command line interface for manipulating JSON directly, and a user defined function (UDF) that can be called. (Many third-party software vendors are also supporting JSON in their own ways.)
“For the developer, the most important function is the JSON API, which allows Java servlet-based applications to easily produce and process JSON that is exchanged with Web browser applications,” Eberhard says. Since DB2 for i has support for Java procedures and functions, the JSON API can be called by any other IBM i language that speaks SQL, including RPG, PHP, and COBOL.
The extensibility of JSON is a clear win for developers looking to build modern Web and mobile applications atop the IBM i platform. Developers who are familiar with other NoSQL databases that use JSON data formats–such as Couchbase and MongoDB (the DB2 JSON store actually implements parts of MongoDB’s open source BSON query engine)–should feel at home working with JSON/BSON documents stored on DB2 for i.
But this being IBM–which protects the backward compatibility of its customer’s IT investments stretching back into the decades–you can bet that the JSON DB2 store brings a little something for the operators and administrators tasked with actually running the stuff, too.
“For the business, the DB2 JSON Store allows clients to leverage their investments in DR and HA [disaster recovery and high availability] infrastructure to improve their data availability posture,” Eberhard says. “This point resonates with our clients because we’re bridging between two important business requirements: developer productivity and reliability of service.”
In many ways, the adventure into JSON technology parallels the adventures IBM i shops have taken with XML, which started becoming a big thing around the turn of the century.
“Much like what you saw happen with XML, DB2 for i customers will benefit from having JSON-specific features built into the database,” Eberhard says. “As mentioned earlier, clients can rely upon their considerable investment in DR/HA on IBM i. Even though the JSON collections (documents) are not a column in your favorite table, the data resides in DB2 for i, where you can count on it being there when you need it.”
The JSON data store is an important first step in getting JSON data on the IBM i platform. It also brings clear advantages for IBM i shops looking to develop and use modern Web and mobile applications in the manner that has become an industry standard.
While traditional relational database technology and SQL-based access methods will continue to power many of the internal processes that IBM i servers run on a daily basis, the query and storage methods used to serve data to Web and mobile user interfaces is clearly shifting toward document-oriented designs, with JSON leading the way.