SlideShare a Scribd company logo
Let's talk about NoSQL Standard
Otávio Santana
@otaviojava
otaviojava@java.net
otaviojava@apache.org
NoSQL
● Database
● Doesn't use relationship
● BASE
● Five types
Key Value
● AmazonDynamo
● AmazonS3
● Redis
● Scalaris
● Voldemort
● Couchbase
valuekey
valuekey
valuekey
Document
● AmazonSimpleDb
● ApacheCouchdb
● MongoDb
● Riak
● Couchbase
Column
● Hbase
● Cassandra
● Scylla
● Clouddata
● SimpleDb
● DynamoDB
Row-key Columns...
Apollo
Aphrodi
te
Ares
Sun
Duty
{Love, happy}
Duty
War
Duty
Sword
weapon
Color
Krato
s
Dead Gods
13
Graph
● Neo4j
● InfoGrid
● Sones
● HyperGraphDB
Apollo Ares
Krat
os
was dead was dead
Is brother
killed killed
Multi-model
● OrientDB
● Couchbase
● Elasticsearch
● Cassandra
The Problem
The Problem
The Current solution
● Spring Data
● Hibernate OGM
● TopLink
The Perfect Solution
● Abstraction API
● Communication API
● No lock-in
● Split problems
Apache Diana was Born (incubator)
● API Communication layer
● Apache Project
● Document, key-value, Column, Graph
● Universal Adapter
● Standard
What Diana is not
● A new API to replace JPA
● A new API to abstraction layer
● Just one API communication to solve all kind of NoSQL
database
● Be responsible to do integrations with other technologies such
as CDI, EJB, Bean Validation, Spring, etc.
Diana Project
● Commons API
● Document API
● Graph API
● Key-value API
● Column API
● Four TCKs
Diana Project
Why Diana?
● Goddess of the hunt, nature
and moon
● Fought in Troy
● brave warrior and hunter
Road Map
● Draft and code Proposal
● Community Feedback
● Involve NoSQL Vendors
● Involve Solution Vendors
● Apache Project
● Development
● JSR
Nomenclature
● Configuration
● Factory
● Manager
● Entity
● Value
Value
Value value = Value.of("123");
Integer integerValue = value.get(Integer.class);
List<Integer> list = value.getList(Integer.class);
Set<Integer> set = value.getSet(Integer.class);
Stream<Integer> stream = value.getStream(Integer.class);
String cast = value.cast();//unsafe
Custom Value
public class MoneyWriter implements
WriterField<Money, String> {
@Override
public boolean isCompatible(Class clazz) {
return false;
}
@Override
public String write(Money object) {
return object.toString();
}
}
public class MoneyReader implements
ReaderField {
@Override
public boolean isCompatible(Class clazz) {
return Money.class.equals(clazz);
}
@Override
public <T> T read(Class<T> clazz, Object
value) {
return (T) Money.parse(value.toString());
}
}
Entities
Money money = new Money();
Value value = Value.of(money);
DocumentCollectionEntity entity = DocumentCollectionEntity.of("collection");
entity.add(Document.of("name", "Daniel Soro"));
entity.add(Document.of("age", 26));
entity.add(Document.of("salary", money));
String name = entity.getName();
List<Document> documents = entity.getDocuments();
Optional<Document> age = entity.find("age");
Entities
Money money = new Money();
Value value = Value.of(money);
DocumentCollectionEntity entity = DocumentCollectionEntity.of("collection");
entity.add(Document.of("name", "Daniel Soro"));
entity.add(Document.of("age", 26));
entity.add(Document.of("salary", money));
entity.add(Document.of("subdocument", Document.of("sub", Arrays.asList(1, 2, 3))));
String name = entity.getName();
List<Document> documents = entity.getDocuments();
Optional<Document> age = entity.find("age");
Entities
Money money = new Money();
Value value = Value.of(money);
ColumnFamilyEntity entity = ColumnFamilyEntity.of("family");
Column id = Column.of("id", 10L);
entity.add(id);
entity.add(Column.of("version", 0.001));
entity.add(Column.of("name", "Diana"));
entity.add(Column.of("options", Arrays.asList(1, 2, 3)));
entity.add(Column.of("pay", value));
String name = entity.getName();
List<Column> columns = entity.getColumns();
Optional<Column> notFound = entity.find("notFound");
Entities
Value value = Value.of(new Money());
KeyValue<String> keyValue = KeyValue.of("key", value);
String key = keyValue.getKey();
Value value1 = keyValue.getValue();
Entities
Value value = Value.of(new Money());
KeyValue<String> keyValue = KeyValue.of("key", value);
String key = keyValue.getKey();
Value value1 = keyValue.getValue();
Manager
DocumentCollectionEntity entitySaved = collectionManager.save(entity);
collectionManager.save(entity, TTL.ofHours(2));
collectionManager.saveAsync(entity);
collectionManager.saveAsync(entity, TTL.ofDays(3));
collectionManager.saveAsync(entity, System.out::print);
DocumentQuery query = DocumentQuery.of("collection");
Optional<Document> id = entitySaved.find("_id");
query.addCondition(DocumentCondition.eq(id.get()));
List<DocumentCollectionEntity> documentsFound = collectionManager.find(query);
DocumentCollectionEntity document = collectionManager.findOne(query);
collectionManager.delete(query);
collectionManager.deleteAsync(query);
collectionManager.deleteAsync(query, System.out::print);
Manager
columnEntityManager.save(entity);
columnEntityManager.saveAsync(entity);
columnEntityManager.saveAsync(entity, TTL.ofDays(3));
columnEntityManager.saveAsync(entity, System.out::print);
ColumnQuery query = ColumnQuery.of("family");
query.addCondition(ColumnCondition.eq(id));
List<ColumnFamilyEntity> entities = columnEntityManager.find(query);
ColumnFamilyEntity family = columnEntityManager.findOne(query);
columnEntityManager.delete(query);
columnEntityManager.deleteAsync(query);
columnEntityManager.deleteAsync(query, System.out::print);
Manager
KeyValue<String> keyValue = KeyValue.of("myKey", Value.of("value"));
bucket.put("key", "value");
bucket.put(keyValue);
bucket.put(keyValue, TTL.ofMicros(12));
Optional<Value> value = bucket.get("key");
Factory
BucketManager bucket = managerFactory.getBucketManager("bucket");
List<String> list = managerFactory.getList("bucketList", String.class);
Set<String> set = managerFactory.getSet("bucketSet", String.class);
Map<String, Integer> map = managerFactory.getMap("bucketList", String.class,
Integer.class);
Queue<String> queue = managerFactory.getQueue("queueList", String.class);
Factory
ColumnFamilyManager columnEntityManager =
columnManagerFactory.getColumnEntityManager("space");
DocumentCollectionManager collection =
documentManagerFactory.getDocumentEntityManager("collection");
Configuration
ColumnConfiguration columnConfiguration = new ColumnDriver();
DocumentConfiguration documentConfiguration = new DocumentDriver();
KeyValueConfiguration keyValueConfiguration = new KeyValueDriver();
ColumnFamilyManagerFactory columnFactory = columnConfiguration.getManagerFactory();
DocumentCollectionManagerFactory documentFactory =
documentConfiguration.getManagerFactory();
BucketManagerFactory keyFactory = keyValueConfiguration.getManagerFactory();
Native Query
columnEntityManager.nativeQueryAsync(query, System.out::println);
List<ColumnFamilyEntity> entities = columnEntityManager.nativeQuery(query);
PreparedStatement preparedStatement = columnEntityManager.nativeQueryPrepare(query);
preparedStatement.bind(1,2,3);
preparedStatement.executeQuery();
preparedStatement.executeQueryAsync(System.out::println);
Native Query
collectionManager.nativeQueryAsync(query, System.out::println);
List<DocumentCollectionEntity> entities = collectionManager.nativeQuery(query);
PreparedStatement preparedStatement = collectionManager.nativeQueryPrepare(query);
preparedStatement.bind(1,2,3);
preparedStatement.executeQuery();
preparedStatement.executeQueryAsync(System.out::println);
Diana Query Language
Select
select * from bucket;
select key1, key2 from bucket;
Insert
INSERT INTO bucket VALUES (key, value);
INSERT INTO bucket VALUES (key, value) ttl 20 (seconds, minutes, hours, days);
Delete
DELETE FROM bucket WHERE id =value;
Diana Query Language
Insert
INSERT INTO collection (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
INSERT INTO collection (column1,column2,column3,...)
VALUES (value1,value2,value3,...) (value1,value2,value3,...);
INSERT INTO collection (column1,column2,column3,...)
VALUES (value1,value2,value3,...) ttl 20 (seconds, minutes, hours, days);
INSERT INTO collection (column1,column2,column3,...)
VALUES (value1,value2,value3,...) ttl 20 (seconds, minutes, hours, days) async;
Diana Query Language
Select
select * from collection;
select field, field2 from collection;
select field, field2 from collection where id = 2;
select field, field2 from collection where id >= 2 or field >3;
Delete
DELETE FROM collection WHERE id =value;
DELETE field, field2 FROM collection WHERE id =value;
Diana Query Language
Insert
INSERT INTO family (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
INSERT INTO family (column1,column2,column3,...)
VALUES (value1,value2,value3,...) (value1,value2,value3,...);
INSERT INTO family (column1,column2,column3,...)
VALUES (value1,value2,value3,...) ttl 20 (seconds, minutes, hours, days);
INSERT INTO family (column1,column2,column3,...)
VALUES (value1,value2,value3,...) ttl 20 (seconds, minutes, hours, days) async;
Diana Query Language
Select
select * from family;
select field, field2 from family;
select field, field2 from family where id = 2;
select field, field2 from family where id >= 2 and index >3;
Delete
DELETE FROM family WHERE id =value;
DELETE field, field2 FROM family WHERE id =value;
Site
https://jnosql.github.io/diana-site/
Code
https://github.com/JNOSQL
Apache Proposal
https://wiki.apache.org/incubator/DianaProposal
Thank you
Otávio Santana
@otaviojava
otaviojava@java.net
otaviojava@apache.org

More Related Content

What's hot

jQuery
jQueryjQuery
2011 Mongo FR - Indexing in MongoDB
2011 Mongo FR - Indexing in MongoDB2011 Mongo FR - Indexing in MongoDB
2011 Mongo FR - Indexing in MongoDB
antoinegirbal
 
Spray Json and MongoDB Queries: Insights and Simple Tricks.
Spray Json and MongoDB Queries: Insights and Simple Tricks.Spray Json and MongoDB Queries: Insights and Simple Tricks.
Spray Json and MongoDB Queries: Insights and Simple Tricks.
Andrii Lashchenko
 
Jquery
JqueryJquery
Jquery
Zoya Shaikh
 
Solr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg DonovanSolr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg Donovan
Gregg Donovan
 
Validating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentationValidating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentation
Dave Stokes
 
UKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the DatabaseUKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the Database
Marco Gralike
 
J query
J queryJ query
J query
Manav Prasad
 
J query1
J query1J query1
J query1
Manav Prasad
 
Fast querying indexing for performance (4)
Fast querying   indexing for performance (4)Fast querying   indexing for performance (4)
Fast querying indexing for performance (4)
MongoDB
 
An introduction into Spring Data
An introduction into Spring DataAn introduction into Spring Data
An introduction into Spring Data
Oliver Gierke
 
Hibernate Tutorial for beginners
Hibernate Tutorial for beginnersHibernate Tutorial for beginners
Hibernate Tutorial for beginners
rajkamal560066
 
09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP
Nguyen Tuan
 
Webinar: Simplifying Persistence for Java and MongoDB
Webinar: Simplifying Persistence for Java and MongoDBWebinar: Simplifying Persistence for Java and MongoDB
Webinar: Simplifying Persistence for Java and MongoDB
MongoDB
 
appengine java night #1
appengine java night #1appengine java night #1
appengine java night #1
Shinichi Ogawa
 
ORMLite Android
ORMLite AndroidORMLite Android
ORMLite Android
哲偉 楊
 
Webinar: Index Tuning and Evaluation
Webinar: Index Tuning and EvaluationWebinar: Index Tuning and Evaluation
Webinar: Index Tuning and Evaluation
MongoDB
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NET
Tomas Jansson
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query Optimization
MongoDB
 

What's hot (19)

jQuery
jQueryjQuery
jQuery
 
2011 Mongo FR - Indexing in MongoDB
2011 Mongo FR - Indexing in MongoDB2011 Mongo FR - Indexing in MongoDB
2011 Mongo FR - Indexing in MongoDB
 
Spray Json and MongoDB Queries: Insights and Simple Tricks.
Spray Json and MongoDB Queries: Insights and Simple Tricks.Spray Json and MongoDB Queries: Insights and Simple Tricks.
Spray Json and MongoDB Queries: Insights and Simple Tricks.
 
Jquery
JqueryJquery
Jquery
 
Solr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg DonovanSolr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg Donovan
 
Validating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentationValidating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentation
 
UKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the DatabaseUKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the Database
 
J query
J queryJ query
J query
 
J query1
J query1J query1
J query1
 
Fast querying indexing for performance (4)
Fast querying   indexing for performance (4)Fast querying   indexing for performance (4)
Fast querying indexing for performance (4)
 
An introduction into Spring Data
An introduction into Spring DataAn introduction into Spring Data
An introduction into Spring Data
 
Hibernate Tutorial for beginners
Hibernate Tutorial for beginnersHibernate Tutorial for beginners
Hibernate Tutorial for beginners
 
09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP09.Local Database Files and Storage on WP
09.Local Database Files and Storage on WP
 
Webinar: Simplifying Persistence for Java and MongoDB
Webinar: Simplifying Persistence for Java and MongoDBWebinar: Simplifying Persistence for Java and MongoDB
Webinar: Simplifying Persistence for Java and MongoDB
 
appengine java night #1
appengine java night #1appengine java night #1
appengine java night #1
 
ORMLite Android
ORMLite AndroidORMLite Android
ORMLite Android
 
Webinar: Index Tuning and Evaluation
Webinar: Index Tuning and EvaluationWebinar: Index Tuning and Evaluation
Webinar: Index Tuning and Evaluation
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NET
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query Optimization
 

Similar to Let's talk about NoSQL Standard

Palestra Java + NoSQL = Iniciativa JNoSQL no TDC Florianópolis
Palestra Java + NoSQL = Iniciativa JNoSQL  no TDC FlorianópolisPalestra Java + NoSQL = Iniciativa JNoSQL  no TDC Florianópolis
Palestra Java + NoSQL = Iniciativa JNoSQL no TDC Florianópolis
Marcelo Souza Vieira
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
tdc-globalcode
 
JakartaData-JCon.pptx
JakartaData-JCon.pptxJakartaData-JCon.pptx
JakartaData-JCon.pptx
EmilyJiang23
 
.NET Database Toolkit
.NET Database Toolkit.NET Database Toolkit
.NET Database Toolkit
wlscaudill
 
Jakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud AgeJakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud Age
Otávio Santana
 
Jakarta EE Meets NoSQL at the Cloud Age | JakartaOne Livestream
Jakarta EE Meets NoSQL at the Cloud Age | JakartaOne LivestreamJakarta EE Meets NoSQL at the Cloud Age | JakartaOne Livestream
Jakarta EE Meets NoSQL at the Cloud Age | JakartaOne Livestream
Jakarta_EE
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!
Oliver Gierke
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
GaryCoady
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
JavaDayUA
 
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
LogeekNightUkraine
 
The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202
Mahmoud Samir Fayed
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
Nelson Glauber Leal
 
Building an api using golang and postgre sql v1.0
Building an api using golang and postgre sql v1.0Building an api using golang and postgre sql v1.0
Building an api using golang and postgre sql v1.0
Frost
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
Thodoris Bais
 
Requery overview
Requery overviewRequery overview
Requery overview
Sunghyouk Bae
 
Implementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDBImplementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDB
Oren Eini
 
Using Arbor/ RGraph JS libaries for Data Visualisation
Using Arbor/ RGraph JS libaries for Data VisualisationUsing Arbor/ RGraph JS libaries for Data Visualisation
Using Arbor/ RGraph JS libaries for Data Visualisation
Alex Hardman
 
Xlab #1: Advantages of functional programming in Java 8
Xlab #1: Advantages of functional programming in Java 8Xlab #1: Advantages of functional programming in Java 8
Xlab #1: Advantages of functional programming in Java 8
XSolve
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected World
Christian Melchior
 
What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?
Trisha Gee
 

Similar to Let's talk about NoSQL Standard (20)

Palestra Java + NoSQL = Iniciativa JNoSQL no TDC Florianópolis
Palestra Java + NoSQL = Iniciativa JNoSQL  no TDC FlorianópolisPalestra Java + NoSQL = Iniciativa JNoSQL  no TDC Florianópolis
Palestra Java + NoSQL = Iniciativa JNoSQL no TDC Florianópolis
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
 
JakartaData-JCon.pptx
JakartaData-JCon.pptxJakartaData-JCon.pptx
JakartaData-JCon.pptx
 
.NET Database Toolkit
.NET Database Toolkit.NET Database Toolkit
.NET Database Toolkit
 
Jakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud AgeJakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud Age
 
Jakarta EE Meets NoSQL at the Cloud Age | JakartaOne Livestream
Jakarta EE Meets NoSQL at the Cloud Age | JakartaOne LivestreamJakarta EE Meets NoSQL at the Cloud Age | JakartaOne Livestream
Jakarta EE Meets NoSQL at the Cloud Age | JakartaOne Livestream
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
 
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
Andriy Slobodyanyk "How to Use Hibernate: Key Problems and Solutions"
 
The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202
 
Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
Building an api using golang and postgre sql v1.0
Building an api using golang and postgre sql v1.0Building an api using golang and postgre sql v1.0
Building an api using golang and postgre sql v1.0
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
 
Requery overview
Requery overviewRequery overview
Requery overview
 
Implementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDBImplementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDB
 
Using Arbor/ RGraph JS libaries for Data Visualisation
Using Arbor/ RGraph JS libaries for Data VisualisationUsing Arbor/ RGraph JS libaries for Data Visualisation
Using Arbor/ RGraph JS libaries for Data Visualisation
 
Xlab #1: Advantages of functional programming in Java 8
Xlab #1: Advantages of functional programming in Java 8Xlab #1: Advantages of functional programming in Java 8
Xlab #1: Advantages of functional programming in Java 8
 
Painless Persistence in a Disconnected World
Painless Persistence in a Disconnected WorldPainless Persistence in a Disconnected World
Painless Persistence in a Disconnected World
 
What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?What do you mean, Backwards Compatibility?
What do you mean, Backwards Compatibility?
 

Recently uploaded

Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 

Recently uploaded (20)

Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 

Let's talk about NoSQL Standard

  • 1. Let's talk about NoSQL Standard Otávio Santana @otaviojava otaviojava@java.net otaviojava@apache.org
  • 2. NoSQL ● Database ● Doesn't use relationship ● BASE ● Five types
  • 3. Key Value ● AmazonDynamo ● AmazonS3 ● Redis ● Scalaris ● Voldemort ● Couchbase valuekey valuekey valuekey
  • 4. Document ● AmazonSimpleDb ● ApacheCouchdb ● MongoDb ● Riak ● Couchbase
  • 5. Column ● Hbase ● Cassandra ● Scylla ● Clouddata ● SimpleDb ● DynamoDB Row-key Columns... Apollo Aphrodi te Ares Sun Duty {Love, happy} Duty War Duty Sword weapon Color Krato s Dead Gods 13
  • 6. Graph ● Neo4j ● InfoGrid ● Sones ● HyperGraphDB Apollo Ares Krat os was dead was dead Is brother killed killed
  • 7. Multi-model ● OrientDB ● Couchbase ● Elasticsearch ● Cassandra
  • 10. The Current solution ● Spring Data ● Hibernate OGM ● TopLink
  • 11. The Perfect Solution ● Abstraction API ● Communication API ● No lock-in ● Split problems
  • 12. Apache Diana was Born (incubator) ● API Communication layer ● Apache Project ● Document, key-value, Column, Graph ● Universal Adapter ● Standard
  • 13. What Diana is not ● A new API to replace JPA ● A new API to abstraction layer ● Just one API communication to solve all kind of NoSQL database ● Be responsible to do integrations with other technologies such as CDI, EJB, Bean Validation, Spring, etc.
  • 14. Diana Project ● Commons API ● Document API ● Graph API ● Key-value API ● Column API ● Four TCKs
  • 16. Why Diana? ● Goddess of the hunt, nature and moon ● Fought in Troy ● brave warrior and hunter
  • 17. Road Map ● Draft and code Proposal ● Community Feedback ● Involve NoSQL Vendors ● Involve Solution Vendors ● Apache Project ● Development ● JSR
  • 18. Nomenclature ● Configuration ● Factory ● Manager ● Entity ● Value
  • 19. Value Value value = Value.of("123"); Integer integerValue = value.get(Integer.class); List<Integer> list = value.getList(Integer.class); Set<Integer> set = value.getSet(Integer.class); Stream<Integer> stream = value.getStream(Integer.class); String cast = value.cast();//unsafe
  • 20. Custom Value public class MoneyWriter implements WriterField<Money, String> { @Override public boolean isCompatible(Class clazz) { return false; } @Override public String write(Money object) { return object.toString(); } } public class MoneyReader implements ReaderField { @Override public boolean isCompatible(Class clazz) { return Money.class.equals(clazz); } @Override public <T> T read(Class<T> clazz, Object value) { return (T) Money.parse(value.toString()); } }
  • 21. Entities Money money = new Money(); Value value = Value.of(money); DocumentCollectionEntity entity = DocumentCollectionEntity.of("collection"); entity.add(Document.of("name", "Daniel Soro")); entity.add(Document.of("age", 26)); entity.add(Document.of("salary", money)); String name = entity.getName(); List<Document> documents = entity.getDocuments(); Optional<Document> age = entity.find("age");
  • 22. Entities Money money = new Money(); Value value = Value.of(money); DocumentCollectionEntity entity = DocumentCollectionEntity.of("collection"); entity.add(Document.of("name", "Daniel Soro")); entity.add(Document.of("age", 26)); entity.add(Document.of("salary", money)); entity.add(Document.of("subdocument", Document.of("sub", Arrays.asList(1, 2, 3)))); String name = entity.getName(); List<Document> documents = entity.getDocuments(); Optional<Document> age = entity.find("age");
  • 23. Entities Money money = new Money(); Value value = Value.of(money); ColumnFamilyEntity entity = ColumnFamilyEntity.of("family"); Column id = Column.of("id", 10L); entity.add(id); entity.add(Column.of("version", 0.001)); entity.add(Column.of("name", "Diana")); entity.add(Column.of("options", Arrays.asList(1, 2, 3))); entity.add(Column.of("pay", value)); String name = entity.getName(); List<Column> columns = entity.getColumns(); Optional<Column> notFound = entity.find("notFound");
  • 24. Entities Value value = Value.of(new Money()); KeyValue<String> keyValue = KeyValue.of("key", value); String key = keyValue.getKey(); Value value1 = keyValue.getValue();
  • 25. Entities Value value = Value.of(new Money()); KeyValue<String> keyValue = KeyValue.of("key", value); String key = keyValue.getKey(); Value value1 = keyValue.getValue();
  • 26. Manager DocumentCollectionEntity entitySaved = collectionManager.save(entity); collectionManager.save(entity, TTL.ofHours(2)); collectionManager.saveAsync(entity); collectionManager.saveAsync(entity, TTL.ofDays(3)); collectionManager.saveAsync(entity, System.out::print); DocumentQuery query = DocumentQuery.of("collection"); Optional<Document> id = entitySaved.find("_id"); query.addCondition(DocumentCondition.eq(id.get())); List<DocumentCollectionEntity> documentsFound = collectionManager.find(query); DocumentCollectionEntity document = collectionManager.findOne(query); collectionManager.delete(query); collectionManager.deleteAsync(query); collectionManager.deleteAsync(query, System.out::print);
  • 27. Manager columnEntityManager.save(entity); columnEntityManager.saveAsync(entity); columnEntityManager.saveAsync(entity, TTL.ofDays(3)); columnEntityManager.saveAsync(entity, System.out::print); ColumnQuery query = ColumnQuery.of("family"); query.addCondition(ColumnCondition.eq(id)); List<ColumnFamilyEntity> entities = columnEntityManager.find(query); ColumnFamilyEntity family = columnEntityManager.findOne(query); columnEntityManager.delete(query); columnEntityManager.deleteAsync(query); columnEntityManager.deleteAsync(query, System.out::print);
  • 28. Manager KeyValue<String> keyValue = KeyValue.of("myKey", Value.of("value")); bucket.put("key", "value"); bucket.put(keyValue); bucket.put(keyValue, TTL.ofMicros(12)); Optional<Value> value = bucket.get("key");
  • 29. Factory BucketManager bucket = managerFactory.getBucketManager("bucket"); List<String> list = managerFactory.getList("bucketList", String.class); Set<String> set = managerFactory.getSet("bucketSet", String.class); Map<String, Integer> map = managerFactory.getMap("bucketList", String.class, Integer.class); Queue<String> queue = managerFactory.getQueue("queueList", String.class);
  • 31. Configuration ColumnConfiguration columnConfiguration = new ColumnDriver(); DocumentConfiguration documentConfiguration = new DocumentDriver(); KeyValueConfiguration keyValueConfiguration = new KeyValueDriver(); ColumnFamilyManagerFactory columnFactory = columnConfiguration.getManagerFactory(); DocumentCollectionManagerFactory documentFactory = documentConfiguration.getManagerFactory(); BucketManagerFactory keyFactory = keyValueConfiguration.getManagerFactory();
  • 32. Native Query columnEntityManager.nativeQueryAsync(query, System.out::println); List<ColumnFamilyEntity> entities = columnEntityManager.nativeQuery(query); PreparedStatement preparedStatement = columnEntityManager.nativeQueryPrepare(query); preparedStatement.bind(1,2,3); preparedStatement.executeQuery(); preparedStatement.executeQueryAsync(System.out::println);
  • 33. Native Query collectionManager.nativeQueryAsync(query, System.out::println); List<DocumentCollectionEntity> entities = collectionManager.nativeQuery(query); PreparedStatement preparedStatement = collectionManager.nativeQueryPrepare(query); preparedStatement.bind(1,2,3); preparedStatement.executeQuery(); preparedStatement.executeQueryAsync(System.out::println);
  • 34. Diana Query Language Select select * from bucket; select key1, key2 from bucket; Insert INSERT INTO bucket VALUES (key, value); INSERT INTO bucket VALUES (key, value) ttl 20 (seconds, minutes, hours, days); Delete DELETE FROM bucket WHERE id =value;
  • 35. Diana Query Language Insert INSERT INTO collection (column1,column2,column3,...) VALUES (value1,value2,value3,...); INSERT INTO collection (column1,column2,column3,...) VALUES (value1,value2,value3,...) (value1,value2,value3,...); INSERT INTO collection (column1,column2,column3,...) VALUES (value1,value2,value3,...) ttl 20 (seconds, minutes, hours, days); INSERT INTO collection (column1,column2,column3,...) VALUES (value1,value2,value3,...) ttl 20 (seconds, minutes, hours, days) async;
  • 36. Diana Query Language Select select * from collection; select field, field2 from collection; select field, field2 from collection where id = 2; select field, field2 from collection where id >= 2 or field >3; Delete DELETE FROM collection WHERE id =value; DELETE field, field2 FROM collection WHERE id =value;
  • 37. Diana Query Language Insert INSERT INTO family (column1,column2,column3,...) VALUES (value1,value2,value3,...); INSERT INTO family (column1,column2,column3,...) VALUES (value1,value2,value3,...) (value1,value2,value3,...); INSERT INTO family (column1,column2,column3,...) VALUES (value1,value2,value3,...) ttl 20 (seconds, minutes, hours, days); INSERT INTO family (column1,column2,column3,...) VALUES (value1,value2,value3,...) ttl 20 (seconds, minutes, hours, days) async;
  • 38. Diana Query Language Select select * from family; select field, field2 from family; select field, field2 from family where id = 2; select field, field2 from family where id >= 2 and index >3; Delete DELETE FROM family WHERE id =value; DELETE field, field2 FROM family WHERE id =value;