Everything shall pass except Object-Relational Impedance Mismatch. Despite many years of research and development in this area, applications and databases still struggle with communication issues.
An incompatibility of data models between object-oriented application code and a database engine causes multiple performance problems and triggers over-complicated application design.
In this talk, we describe a solution for high-level information exchange between PostgreSQL database and Java applications. With this solution we can completely eliminate the usage of any ORM. Instead of low-level (attribute-to-column) mapping typical for an ORM, our technique relies on high-level structure-preserving model mapping.
We provide the data transfer between the app and the database with close-to-zero overhead, returning data in the JSON format, which makes it easy for the application to consume the data. Although we developed this methodology for Java applications, it can be used for any programming language which utilizes JSON as a data transfer format. On the PostgreSQL side, we can maintain the strong types and optimize the database queries independently from the application.
The proposed solution is fully implemented in the industrial settings based on cloud services. In our talk we will show how this technique streamlines application development and, at the same time, provides significant performance gains.