SlideShare a Scribd company logo
1 of 42
Download to read offline
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

appengine java night #1
appengine java night #1appengine java night #1
appengine java night #1
Shinichi Ogawa
 
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

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

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 ...
 
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
 
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?
 

More from Otávio Santana

More from Otávio Santana (20)

NoSQL design pitfalls with Java
NoSQL design pitfalls with JavaNoSQL design pitfalls with Java
NoSQL design pitfalls with Java
 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
 
Architecting Cloud Computing Solutions with Java [1.1]
Architecting Cloud Computing Solutions with Java [1.1]Architecting Cloud Computing Solutions with Java [1.1]
Architecting Cloud Computing Solutions with Java [1.1]
 
Arquitetando soluções de computação em nuvem com Java
Arquitetando soluções de computação em nuvem com JavaArquitetando soluções de computação em nuvem com Java
Arquitetando soluções de computação em nuvem com Java
 
Build, run, and scale your Java applications end to end
Build, run, and scale your Java applications end to endBuild, run, and scale your Java applications end to end
Build, run, and scale your Java applications end to end
 
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
Jakarta NoSQL: Meet the first Jakarta EE specification in the CloudJakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
 
ORMs: Heroes or Villains Inside the Architecture?
ORMs: Heroes or Villains Inside the Architecture?ORMs: Heroes or Villains Inside the Architecture?
ORMs: Heroes or Villains Inside the Architecture?
 
Boost your APIs with GraphQL 1.0
Boost your APIs with GraphQL 1.0Boost your APIs with GraphQL 1.0
Boost your APIs with GraphQL 1.0
 
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
 
Let’s Make Graph Databases Fun Again with Java [DEV6043]
Let’s Make Graph Databases Fun Again with Java [DEV6043]Let’s Make Graph Databases Fun Again with Java [DEV6043]
Let’s Make Graph Databases Fun Again with Java [DEV6043]
 
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
 
The new generation of data persistence with graph
The new generation of data persistence with graphThe new generation of data persistence with graph
The new generation of data persistence with graph
 
Eclipse JNoSQL updates from JCP September 11
Eclipse JNoSQL updates from JCP September 11Eclipse JNoSQL updates from JCP September 11
Eclipse JNoSQL updates from JCP September 11
 
Stateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - GuatemalaStateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - Guatemala
 
Stateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - MexicoStateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - Mexico
 
Polyglot persistence
Polyglot persistencePolyglot persistence
Polyglot persistence
 
Management 3.0 and open source
Management 3.0 and open sourceManagement 3.0 and open source
Management 3.0 and open source
 
Building a Recommendation Engine with Java EE
Building a Recommendation Engine with Java EEBuilding a Recommendation Engine with Java EE
Building a Recommendation Engine with Java EE
 
Cassandra NoSQL, NoLimits!
Cassandra NoSQL, NoLimits!Cassandra NoSQL, NoLimits!
Cassandra NoSQL, NoLimits!
 
Disasters of the century NoSQL
Disasters of the century NoSQLDisasters of the century NoSQL
Disasters of the century NoSQL
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

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;