Db2Rest

Instant no code DATA API platform for relational databases. Connect any database, run anywhere. Power your GENAI application function/tools calls in seconds.

Last verified:

Visit Db2Rest

What is Db2Rest?

DB2Rest is an open-source, no-code REST DATA API platform that automatically creates secure REST API endpoints for relational databases, enabling developers to build intelligent applications 30x faster. It eliminates the need for writing boilerplate database access code, Object Relational Mapping (ORM) frameworks, or code generation, making it blazing fast with single round-trip database access and no compilation overhead.

Key features include instant REST API generation for databases, support for database query caching and batching, gzip compression support, Open API Specification (Swagger UI) generation, and the ability to handle multiple physical databases with name collision resolution via header parameters. DB2Rest works seamlessly with Gen AI applications, vector databases, and LLMs to deliver context-aware, reasoning applications without vendor lock-in.

DB2Rest is designed for developers, enterprises, and teams who want to accelerate application delivery, unlock legacy data, simplify integrations, and securely share data without writing a single line of code. It serves as a secure database gateway for enterprises to open up data to internal developers and partners safely. The tool is ideal for building Gen AI application function/tools calls, modernizing legacy databases, machine learning dataset integration, and real-time data exchange.

The platform supports deployment anywhere - on-premise, bare-metal, Virtual Machines (VMs), Docker, Kubernetes, and any cloud provider. It currently supports PostgreSQL, MySQL, SQLite, MS SQL Server, Oracle (including 9i and 10g), IBM DB2 (11.5.8.0+), MariaDB, CockroachDB, and various cloud database services like AWS RDS, DigitalOcean PostgreSQL/MySQL, Neon, and Amazon Lightsail.

Db2Rest pricing

Pricing model: Freemium

DB2Rest is completely free and open source under the Apache 2.0 license. There are no paid tiers, subscription plans, or enterprise fees. The software can be downloaded freely from the official download links (db2rest-1.6.6.jar) or pulled as a free Docker image (kdhrubo/db2rest:latest). All features including REST API generation, support for all 15+ databases, query caching, batching, gzip compression, Open API Specification, and Gen AI integration are included in the free open-source version with no restrictions. Companies can self-host DB2Rest on-premise, on VMs, in Docker, Kubernetes, or any cloud without any licensing costs.

Db2Rest pros

  • Open source under Apache 2.0 license with no vendor lock-in
  • No-code solution - eliminates boilerplate database access code
  • No ORM overhead for faster performance
  • No code generation or compilation required
  • Boosts development speed by 30x
  • Single round-trip to databases for blazing fast performance
  • Supports database query caching and batching
  • Works with Gen AI, LLMs, and vector databases out of the box
  • Automatic Open API Specification (Swagger UI) generation
  • Supports 15+ databases including PostgreSQL, MySQL, Oracle, SQL Server, IBM DB2, MariaDB
  • Can handle multiple physical databases with name collision resolution
  • Gzip compression support for reduced HTTP response size
  • Runs anywhere - on-premise, Docker, Kubernetes, any cloud
  • Easy Docker deployment with official images available
  • Secure database gateway for enterprise data access control
  • Uses Java 21 virtual threads for high scalability
  • Minimal system requirements - only 2-4 GB RAM needed
  • Single executable JAR file for easy installation
  • Health check actuator endpoint for installation verification
  • Active community with Discord support and GitHub Discussions

Db2Rest cons

  • Requires Java 21+ runtime (cannot run on older Java versions)
  • No client SDKs available for Python, GO, or Javascript
  • Minimum 2-4 GB RAM memory requirement
  • Only supports relational databases (no NoSQL support yet)
  • Latest stable version is 1.6.6 (relatively young project)
  • Limited documentation compared to established enterprise tools
  • Name collision issues when same table names exist across databases without proper header configuration
  • Some planned database features (TursoDB, Yugabyte, PlanetScale) not yet released
  • Java-based which may have higher memory footprint than lightweight alternatives
  • Self-hosted solution requires own infrastructure management

Frequently asked questions about Db2Rest

Can DB2Rest handle multiple physical databases?

Yes, DB2Rest can handle multiple physical databases. The DB2Rest database user account has access to multiple databases, allowing you to query and manage data across different database instances from a single DB2Rest deployment.

Does DB2Rest provide an Open API specification?

Yes, DB2Rest provides an open API Specification that can be used for Go, Python, and Javascript. It can be found by browsing to the automatically provided /swagger-ui/ endpoint path, such as http://127.0.0.1:8080/swagger-ui/index.html.

Is there any SDK available for Python, GO, Javascript?

Currently, DB2Rest does not provide any client SDK for Python, GO, or Javascript. Users need to make direct HTTP requests to the REST API endpoints using their preferred programming language's HTTP client libraries.

How can I handle same table/view names but in different databases?

When the DB2Rest user has access to multiple databases with tables/views having the same names (e.g., DB1.users and DB2.users), you can resolve name collisions by specifying the schema/catalog as a header parameter. For GET requests, use the Accept-Profile header to specify the schema. For POST requests, use the Content-Profile header. In joins, specify the schema of the root table using Accept-Profile, and specify schemas for other tables directly as schemaName attribute.

Does DB2Rest support GZIP compression of HTTP Response?

Yes, DB2Rest supports gzip compression to reduce HTTP response size. To enable it, set the parameter GZIP_ENABLED to true. You can also set the minimum response size for compression to kick-in using the GZIP_MIN_RESPONSE_SIZE parameter, which defaults to 1024 bytes.

What databases does DB2Rest support?

DB2Rest supports PostgreSQL, MySQL, SQLite, MS SQL Server, Oracle (including 9i and 10g), IBM DB2 (11.5.8.0+), DigitalOcean PostgreSQL, DigitalOcean MySQL, AWS RDS Postgres, AWS RDS MySQL, MariaDB, CockroachDB, Neon, Amazon Lightsail PostgreSQL, and Amazon Lightsail MySQL. Planned support includes TursoDB, Yugabyte, PlanetScale, CrunchyData, Singlestore, Nile, MindsDB, and DuckDB.

What are the minimum system requirements for DB2Rest?

DB2Rest requires Java 21+ (Java Runtime 21 or above) and 2-4 GB RAM/Memory. It is compiled with Java 21 and uses the Java Virtual Thread feature for high scalability, allowing it to handle high volume requests even on a single machine.

How do I install and run DB2Rest?

First, install JDK 21+. Then download the DB2Rest JAR file (db2rest-1.6.6.jar) from the official download link. Set environment variables DB_USER, DB_PASSWORD, and DB_URL with your database connection details. Finally, run the command 'java -jar db2rest-1.6.6.jar'. The service will start within seconds and be ready to service data access requests on port 8080.

How can I verify that DB2Rest is installed correctly?

Use the actuator health check endpoint to verify installation. Send a GET request to http://[IP_ADDRESS]:8080/actuator/health using curl or HTTPie. A response with HTTP/1.1 200 and status: UP confirms that DB2Rest is up and running correctly.

Can I deploy DB2Rest using Docker?

Yes, DB2Rest has easy Docker deployment. You can pull the official Docker image using 'docker pull kdhrubo/db2rest:v1.6.5' or 'docker pull kdhrubo/db2rest:latest'. The Docker container can be run on any system with Docker installed, making deployment simple and consistent across environments.

Categories

Use cases

Browse all AI tools on NeedAnAI