Drivers and ORMs for YugabyteDB

Drivers and ORMs

Drivers and ORMs for YugabyteDB

The Yugabyte Structured Query Language (YSQL) API builds upon and extends a fork of the query layer from PostgreSQL, with the intent of supporting most PostgreSQL functionality. Client applications can use the PostgreSQL drivers to read and write data into YugabyteDB databases. YSQL-compatible PostgreSQL drivers are listed in the compatibility matrix below.

In addition to the compatible upstream PostgreSQL drivers, YugabyteDB also supports smart drivers, which extend the PostgreSQL drivers to enable client applications to connect to YugabyteDB clusters without the need for external load balancers. YugabyteDB smart drivers have the following features:

  • Cluster-aware. Drivers know about all the data nodes in a YugabyteDB cluster, eliminating the need for an external load balancer.
  • Topology-aware. For geographically-distributed applications, the driver can seamlessly connect to the geographically nearest regions and availability zones for lower latency.

All YugabyteDB smart driver libraries are actively maintained, and receive bug fixes, performance enhancements, and security patches.

Supported libraries

The following libraries are officially supported by YugabyteDB.

Java

Driver/ORM (* Recommended) Support Level Example apps
YugabyteDB JDBC Smart Driver* [Recommended] Full CRUD Example
PostgreSQL JDBC Driver Full CRUD Example
Hibernate Full CRUD Example
Spring Data YugabyteDB Full CRUD Example
Spring Data JPA Full CRUD Example

Go

Driver/ORM Support Level Example apps
PGX [Recommended] Full CRUD Example
PQ Full CRUD Example
GORM Full CRUD Example
PG Full CRUD Example

Node.js

Driver/ORM Support Level Example apps
PostgreSQL Full CRUD Example
Sequelize Full CRUD Example
Prisma Full CRUD Example

C#

Name Type Support Example
Npgsql Driver Full CRUD Example
EntityFramework ORM Full CRUD Example

Python

Driver/ORM (* Recommended) Support Level Example apps
Yugabyte Psycopg2* [Recommended] Full CRUD Example
PostgreSQL Psycopg2 Full CRUD Example
aiopg Full Quick Start
Django Full CRUD Example
SQLAlchemy Full CRUD Example

Rust

Driver/ORM Support Level Example apps
Diesel Full Diesel