Once upon a time when all databases were relational and supported SQL, Java programmers (almost) did not care about the database type they were going to use. This was achieved by using JDBC drivers - software that talks to the specific database exposing standard API to the application layer.
The world has changed after the invention of NoSQL databases. These databases have some advantages comparing to the traditional relational databases but they do not have common interface. Therefore, using them requires writing specific application code for each database.
Aerospike is a popular, fast, mature NoSQL database. It provides client libraries for different systems and languages including Java. These libraries help to implement applications that use Aerospike DB. However, application code which uses this library has to be specific for Aerospike.
The Aerospike JDBC Driver enables users to connect with Aerospike DB directly from any application that supports standard JDBC connectivity.
This is a JDBC driver. It can be used by any JDBC complaint application, e.g. UI, monitoring, querying and other general purpose tools. It supports standard SQL statements and functions and can be used by developers, QA, data analysts and DevOps engineers. It can help if somebody wants to migrate his application from relational DB to Aerospike.
This article will briefly enumerate the key features of the driver. The next articles of this series will explain particular features in depth.
WHERE - using PK or any other column and the combination of them including calculations, parentheses etc.
JOIN, LEFT JOIN
The driver supports all basic Aerospike types (integer, string, bytes,
double) mapping them to JDBC types (
DOUBLE) respectively and corresponding java types (
double). Aerospike lists and maps are supported as well. They are mapped to the JDBC
java.sql.Array and java.util.Map respectively.
Additionally driver can store and retrieve java objects using either standard java serialization mechanism (for
Externalizable classes) or using custom serialization/deserialization) enabled by user defined functions.
Mathematical expressions can be used in the queries:
select first_name, last_name, year()-year_of_birth as age from people
- aggregation functions:
- string functions:
len(), reverse() etc.
- date/time functions:
The driver provides a lot of built-in functions. Moreover, it can be easily extended. User can implement his own functions in Java and register them via JDBC connection parameters.
The project is available in GitHub.
Next article of this series will explain the SQL compliance of the driver.