From bf372aae4008b5680e1d969d31fe4918f113db5d Mon Sep 17 00:00:00 2001 From: Nathaniel Date: Fri, 22 Dec 2023 00:35:22 -0700 Subject: [PATCH] readme changes --- README.md | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a4772f..07d55c2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,93 @@ +## Overview NucleoDB is an innovative in-memory, embedded database system designed to provide high-speed data management and processing. Its in-memory architecture ensures rapid access and manipulation of data, making it ideal for applications where performance and quick response times are critical. Being embedded, NucleoDB seamlessly integrates into various applications, offering a streamlined and efficient way to handle data within the application's own environment. This design approach not only simplifies the application architecture but also enhances overall system performance by reducing the need for external data calls. -One of the key features of NucleoDB is its sophisticated interaction with Kafka, a popular distributed streaming platform. NucleoDB connects directly to a Kafka cluster, with each table within NucleoDB corresponding to a separate Kafka topic. This setup facilitates efficient data streaming and synchronization between NucleoDB and Kafka, enabling real-time data processing and analytics. Additionally, NucleoDB includes a specialized 'Connections' table, reserved for linking two entries from different tables together, along with associated metadata. This feature allows for the creation of complex relationships and data structures within the database, enhancing its capability to handle diverse and intricate data models. The integration with Kafka, combined with its in-memory and embedded qualities, positions NucleoDB as a powerful tool for modern, data-driven applications. +### Installation + +##### Dependencies + +* Kafka Cluster + * /docker/kafka/docker-compose.yml + +##### Import library +```groovy +repositories { + mavenCentral() + maven { url "https://nexus.synload.com/repository/maven-repo-releases/" } +} +dependencies { + implementation 'com.nucleodb:library:1.13.18' +} +``` + +##### Initializing DB +```java +import com.nucleodb.library.NucleoDB; + +class Application{ + public static void main(String[] args) { + NucleoDB nucleoDB = new NucleoDB( + NucleoDB.DBType.NO_LOCAL, + "com.package.string" + ); + } +} +``` + +```java + +import java.io.Serializable; + +@Table(tableName = "author", dataEntryClass = AuthorDE.class) +public class Author implements Serializable { + @Index + String name; + public Author(String name) { + this.name = name; + } + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} + +public class AuthorDE extends DataEntry{ + +} +``` + +##### Read data +```java +class Application { + public static void main(String[] args) { + Set first = nucleoDB.getTable(Author.class).get("name", "test", new DataEntryProjection(){{ + setWritable(true); + }}); + } +} +``` + +##### Write data + +```java +class Application{ + public static void main(String[] args) { + AuthorDE test = new AuthorDE(new Author("test")); + nucleoDB.getTable(Author.class).saveSync(test); + } +} +``` + +##### Delete data + +```java +class Application{ + public static void main(String[] args) { + // read data + // var author = AuthorDE() + nucleoDB.getTable(Author.class).deleteSync(author); + } +} +``` \ No newline at end of file