Skip to content

Latest commit

 

History

History
117 lines (85 loc) · 3.27 KB

File metadata and controls

117 lines (85 loc) · 3.27 KB

Jakarta NoSQL (Communication API)

Communication API

The Communication API defines a minimal and extensible foundation for interacting with NoSQL databases while preserving the native semantics and operational behavior of the underlying database implementation.

The API focuses on low-level lifecycle operations such as storing, retrieving, replacing, and removing data structures according to the capabilities and characteristics of the target database.

The Communication API is intentionally designed to support:

  • Minimal abstraction

  • Provider neutrality

  • Extensibility

  • Preservation of native database semantics

  • Low-level communication operations

Communication managers may be configured using mechanisms such as Java properties, environment variables, dependency injection, configuration files, or provider-specific communication contexts according to the underlying database implementation.

Key-Value

The key-value communication model represents interaction with NoSQL databases based on the association of a unique key to a value.

BucketManagerFactory factory = ...
BucketManager manager = factory.get("users");
KeyValueRecord record = ...

manager.put(record);
Optional<KeyValueRecord> result = manager.findByKey("user:10");
manager.deleteByKey("user:10");

Document

The document communication model represents interaction with NoSQL databases based on hierarchical and nested document structures.

DocumentManagerFactory factory = ...
DocumentManager manager = factory.get("users");
DocumentRecord record = ...

manager.put(record);
Optional<DocumentRecord> result = manager.findByKey("user:10");
manager.deleteByKey("user:10");

Document records expose document elements through named structures.

DocumentRecord record = ...
Optional<String> name = record.get("name");

Column

The column-family communication model represents interaction with NoSQL databases based on sparse and partition-oriented column structures.

ColumnManagerFactory factory = ...
ColumnManager manager = factory.get("users");
ColumnRecord record = ...

manager.put(record);
Optional<ColumnRecord> result = manager.findByKey("user:10");
manager.deleteByKey("user:10");

Column records expose sparse collections of columns associated with a logical record structure.

ColumnRecord record = ...
Optional<String> name = record.get("name");

Graph

The graph communication model represents interaction with graph-oriented NoSQL databases based on connected structures composed of vertices, edges, and properties.

GraphManagerFactory factory = ...
GraphManager manager = factory.get("social");
Vertex vertex = ...

manager.put(vertex);
Optional<Vertex> result = manager.findVertexById("user:10");
manager.deleteVertexById("user:10");

Edges represent relationships between vertices according to the semantics of the underlying database implementation.

Edge edge = ...

String type = edge.type();
String source = edge.source();
String target = edge.target();

Maven dependency

<dependency>
    <groupId>jakarta.nosql</groupId>
    <artifactId>jakarta.nosql.communication-api</artifactId>
    <version>1.1.0-M3</version>
</dependency>