SQL and Relational Databases

seancorfield/next.jdbc is the defacto Clojure wrapper for SQL queries and managing connections to relational databases.

next.jdbc supports a wide range of databases and automatically pulls in the relevant database drivers. Abstractions are provided for insert, query, update and delete actions, which define data in a hash map allow the use of Clojure specifications (clojure.spec or Malli) for validation and generative testing.

Relational Databases

This guide will use the following relational databases

  • H2 database - lightweight in-process database that writes to disk, easily added for a fast and simple dev environment.
  • Postgresql - open source, feature rich and production grade database (defacto production choice)

Other persistent storage approach include

  • Amazon RDS - a postgres-like storage as an AWS service (should work just like postgres)
  • CockroachDB an elastic, indestructible SQL database for developers building modern applications
  • yugabyteDB open source, cloud native relational DB for powering global, internet-scale apps.

Key Value stores

  • Redis
  • RocksDB is a high performance embedded persistent key-value store with fast storage writes (fork of Google's LevelDB)
  • AWS Dynamo - 400k limit per stored value

Clojure databases

  • Crux - open database with temporal graph query
  • Datomic - transactional database with a flexible data model, elastic scaling, and rich queries Interesting databases in the Clojure spaces include Datomic and Crux.

Database drivers

Database drivers for commonly used database

Database drivers may require a minimum version of Java, so consider Java 8 as the minimum version and Java 11 as the recommended version (until a new long term support version of Java is release).

see database support at http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html (is this up to date?)

Feedback welcome

results matching ""

    No results matching ""