immudb4j-get-started


immudb is lightweight, high-speed immutable database for systems and applications. immudb is open source under the Apache v2.0 License.

With immudb you can track changes in sensitive data in your transactional databases and then record those changes indelibly in a tamperproof database. immudb makes sure that not just the latest data, but the complete history of, say, your debit/credit transactions is stored unchangeable.

Setup immudb

If you haven’t setup immudb yet, this is the time to do so. You only need to start immudb either as a process, a service or a docker container.

It’s up to you if you want to build the Docker /images/blog yourself based on the Dockerfiles in the GitHub repository or use the prebuild ones on Dockerhub.

immudb is using the following defaults:

  • Auth user: immudb
  • Auth password: immudb
  • Service Port: 3322 (immudb)
  • Metrics Port: 9497 (Prometheus exporter)

immudb Dockerhub

docker run -it -d -p 3322:3322 -p 9497:9497 — name immudb codenotary/immudb:latest

standalone Binaries

Each release provides all binaries for different operating systems. you can find these here: immudb releases

If you want to build the **binaries **yourself, simply clone this repo and run one of the following commands based on your operating system.

# Linux
GOOS=linux GOARCH=amd64 make immudb-static
# macOS
GOOS=darwin GOARCH=amd64 make immudb-static
# Microsoft Windows
GOOS=windows GOARCH=amd64 make immudb-static

Then you can run immudb

# run immudb in the foreground 
./immudb
# run immudb in the background 
./immudb -d

install immudb as a service

# install immudb service 
./immudb service install
# check current immudb service status 
./immudb service status
# stop immudb service 
./immudb service stop
# start immudb service 
./immudb service start

Where to find the official Java SDK for immudb

The always up2date Java SDK for immudb can be find as immudb4j on Github

immudb4j Introduction

immudb4j implements a grpc immudb client. A minimalist API is exposed for applications while cryptographic verifications and state update protocol implementation are fully implemented by this client. Latest validated immudb state may be keep in the local filesystem when using default FileRootHolder, please read immudb research paper for details of how immutability is ensured by immudb.

Installation

Just include immudb4j as a dependency in your project:

if using Maven:

    <dependency>
        <groupId>io.codenotary</groupId>
        <artifactId>immudb4j</artifactId>
        <version>0.1.8</version>
    </dependency> 

if using Gradle:

    compile 'io.codenotary:immudb4j:0.1.8'

immudb4j hosted on Maven Central.

Supported Versions

immudb4j supports the latest immudb release.

Quickstart

Hello Immutable World! example can be found in immudb-client-examples repo.

Follow its README to build and run it.

Step by step guide

Creating a Client

The following code snippets shows how to create a client.

Using default configuration:

ImmuClient immuClient = ImmuClient.newBuilder().build();

Setting immudb url and port:

ImmuClient immuClient = ImmuClient.newBuilder()
                            .setServerUrl("localhost")
                            .setServerPort(3322)
                            .build();

Customizing the Root Holder:

FileRootHolder rootHolder = FileRootHolder.newBuilder()
                                .setRootsFolder("./my_immuapp_roots")
                                .build();

ImmuClient immuClient = ImmuClient.newBuilder()
                                  .withRootHolder(rootHolder)
                                  .build();

User sessions

Use login and logout methods to initiate and terminate user sessions:

immuClient.login("usr1", "pwd1");

// Interact with immudb using logged user

immuClient.logout();

Creating a database

Creating a new database is quite simple:

immuClient.createDatabase("db1");

Setting the active database

Specify the active database with:

immuClient.useDatabase("db1");

Traditional read and write

immudb provides read and write operations that behave as a traditional key-value store i.e. no cryptographic verification is done. This operation may be used when validations can be postponed:

client.set("k123", new byte[]{1, 2, 3});

byte[] v = client.get("k123");

Verified or Safe read and write

immudb provides built-in cryptographic verification for any entry. The client implements the mathematical validations while the application uses as a traditional read or write operation:

try {
    client.safeSet("k123", new byte[]{1, 2, 3});

    byte[] v = client.safeGet("k123");

} (catch VerificationException e) {

    //TODO: tampering detected!

}

Closing the client

To programmatically close the connection with immudb server use the shutdown operation:

immuClient.shutdown();

Note: after shutdown, a new client needs to be created to establish a new connection.

There are easier options for non-developers (like immuclient) and also SDK driver for .net, Java, Node.js, Python available.

CNIL Metrics & Logs

Self-Hosted performance monitoring and compliant log analysis for VMware vSphere, container and much more.

immudb

Built on the fastest immutable ledger technology. Open Source and easy to use and integrate into existing application.

Codenotary Cloud

Trusted CI/CD, SBOM and artifact
protection with cryptographic proof.
One CLI to manage all.

Subscribe to Our Newsletter

Get the latest product updates, company news, and special offers delivered right to your inbox.

Subscribe to our newsletter

Use Case - Tamper-resistant Clinical Trials

Goal:

Blockchain PoCs were unsuccessful due to complexity and lack of developers.

Still the goal of data immutability as well as client verification is a crucial. Furthermore, the system needs to be easy to use and operate (allowing backup, maintenance windows aso.).

Implementation:

immudb is running in different datacenters across the globe. All clinical trial information is stored in immudb either as transactions or the pdf documents as a whole.

Having that single source of truth with versioned, timestamped, and cryptographically verifiable records, enables a whole new way of transparency and trust.

Use Case - Finance

Goal:

Store the source data, the decision and the rule base for financial support from governments timestamped, verifiable.

A very important functionality is the ability to compare the historic decision (based on the past rulebase) with the rulebase at a different date. Fully cryptographic verifiable Time Travel queries are required to be able to achieve that comparison.

Implementation:

While the source data, rulebase and the documented decision are stored in verifiable Blobs in immudb, the transaction is stored using the relational layer of immudb.

That allows the use of immudb’s time travel capabilities to retrieve verified historic data and recalculate with the most recent rulebase.

Use Case - eCommerce and NFT marketplace

Goal:

No matter if it’s an eCommerce platform or NFT marketplace, the goals are similar:

  • High amount of transactions (potentially millions a second)
  • Ability to read and write multiple records within one transaction
  • prevent overwrite or updates on transactions
  • comply with regulations (PCI, GDPR, …)


Implementation:

immudb is typically scaled out using Hyperscaler (i. e. AWS, Google Cloud, Microsoft Azure) distributed across the Globe. Auditors are also distributed to track the verification proof over time. Additionally, the shop or marketplace applications store immudb cryptographic state information. That high level of integrity and tamper-evidence while maintaining a very high transaction speed is key for companies to chose immudb.

Use Case - IoT Sensor Data

Goal:

IoT sensor data received by devices collecting environment data needs to be stored locally in a cryptographically verifiable manner until the data is transferred to a central datacenter. The data integrity needs to be verifiable at any given point in time and while in transit.

Implementation:

immudb runs embedded on the IoT device itself and is consistently audited by external probes. The data transfer to audit is minimal and works even with minimum bandwidth and unreliable connections.

Whenever the IoT devices are connected to a high bandwidth, the data transfer happens to a data center (large immudb deployment) and the source and destination date integrity is fully verified.

Use Case - DevOps Evidence

Goal:

CI/CD and application build logs need to be stored auditable and tamper-evident.
A very high Performance is required as the system should not slow down any build process.
Scalability is key as billions of artifacts are expected within the next years.
Next to a possibility of integrity validation, data needs to be retrievable by pipeline job id or digital asset checksum.

Implementation:

As part of the CI/CD audit functionality, data is stored within immudb using the Key/Value functionality. Key is either the CI/CD job id (i. e. Jenkins or GitLab) or the checksum of the resulting build or container image.

White Paper — Registration

We will also send you the research paper
via email.

CodeNotary — Webinar

White Paper — Registration

Please let us know where we can send the whitepaper on CodeNotary Trusted Software Supply Chain. 

Become a partner

Start Your Trial

Please enter contact information to receive an email with the virtual appliance download instructions.

Start Free Trial

Please enter contact information to receive an email with the free trial details.