SlideShare a Scribd company logo
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
JNoSQL
The Definitive Solution for Java
and NoSQL Database
Leonardo Lima Otávio Santana
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
About the Speakers
Leonardo Lima
• Computer engineer, server & embedded sw developer
• From São Paulo, Brasil, currently in Austin, TX
• CTO at V2COM
• Spec Lead – JSR363 – Units of Measurement
• V2COM’s Representative at JCP Executive Committee
[about.me/leomrlima]
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Otávio Santana
• Software engineer, Tomitribe
• From Salvador, Brazil
• Java Champion, SouJava JUG Leader
• Apache, Eclipse and OpenJDK Committer
• Expert Group member in many JSRs
• Representative at JCP EC for SouJava
About the Speakers
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
NoSQL
(Not Only SQL)
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
What defines NoSQL databases?
— No fixed data structure
— Not an ACID, but a BASE
— Five different types
◦ Key/Value
◦ Column Family
◦ Document
◦ Graph
◦ Multi-Model
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
ACID x BASE
Basically
Available,
Soft State,
Eventual consistency
Atomicity,
Consistency,
Isolation,
Durability
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Key/Value
— AmazonDynamo
— AmazonS3
— Redis
— Scalaris
— Voldemort
— Couchbase
— Hazelcast
Apollo Sun
Aphrodite Love
Ares War
Light Music
Beauty
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Row key
Column Family
— Hbase
— Cassandra
— Scylla
— Clouddata
— SimpleDb
— DynamoDB
Apollo
Ares
Kratos
Duty
{”Sun”,“Light”,
”Music”}
Duty
“War”
SlainGods
13
Weapon
“Sword”
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Document
— AmazonSimpleD
— Apache CouchDB
— Couchbase
— MongoDB
— Riak
{
”name”:”Diana”,
”father”:”Jupiter”,
”mother”:”Latona”,
”siblings”:{
”name”: ”Apollo”
},
”godOf”: {”Hunt”}
}
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Graph
— Neo4J
— InfoGrid
— Sones
— HyperGraphDB
Apollo
Ares
Kratos
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Multi-model
— OrientDB
◦ graph, document
— Couchbase
◦ key-value, document
— Elasticsearch
◦ document, graph
— ArangoDB
◦ column family, graph, key-value
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
SQL -> NoSQL
SQL Key-Value Column
Family
Document Graph
Table Bucket Column
Family
Collection
Row Key/Value
pair
Column Document Vertex
Column Key/Value
Pair
Key/Value
Pair
Vertex/Edge
properties
Relationship Link Edge
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Scalability x Complexity
Scalability
Complexity
Key/Value
Document
Column
Family
Graph
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
NoSQL
In Java
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
How Java application interact with…
SQL NoSQL
Logic
DAO
JPA
JDBC
JPA
JDBC
JPA
JDBC
Logic
DAO
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
For example: for a Document DB…
BaseDocument baseDocument = new BaseDocument();
baseDocument.addAttribute(name, value);
JsonObject jsonObject = JsonObject.create();
jsonObject.put(name, value);
Document document = new Document();
document.append(name, value);
ODocument document = new ODocument(“collection”);
document.field(name, value);
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
A first attempt on independence…
Logic
DAO
JPA
— Hibernate OGM
— Eclipse TopLink
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
… brings a bunch of issues!
— Can’t save asynchronously
◦ No callback
— Can’t define aTime to Live (TTL) for stored data
— Consistency Level choice on persist
— Not all DBs are SQL-based
— There are many NoSQL types
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
JNoSQL
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
What is JNoSQL?
— Mapping API - Artemis
— Communication API - Diana
— No lock-in
— Divide and conquer
DAO
Communication
Mapping
JNoSQL
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Eclipse JNoSQL
— Eclipse Foundation
— Apache v2 + EPL 1.0
— API to each NoSQL type
— Configurable
— Extensible Communication
Mapping
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
JNoSQL - Diana
— Communication layer API
— One API for each DB type
◦ Document
◦ Key-value
◦ Column
◦ Graph
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
JNoSQL – Diana APIs
Key/Value Document
Column
Family
Graph
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Back to that Document DB…
DocumentEntity entity = DocumentEntity.of("documentCollection");
Document document = Document.of(name, value);
entity.add(document);
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Names & Definitions
— Configuration
— Factory
— Manager
— Entity
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Names & Definitions
ColumnConfiguration<?> condition = new DriverConfiguration();
try(ColumnFamilyManagerFactory managerFactory = condition.get()) {
ColumnFamilyManager entityManager = managerFactory.get(KEY_SPACE);
entityManager.insert(entity);
ColumnQuery select = select().from(COLUMN_FAMILY).where(eq(id)).build();
ColumnDeleteQuery delete = delete().from(COLUMN_FAMILY)
.where(eq(id)).build();
Optional<ColumnEntity> result = entityManager.singleResult(query);
entityManager.delete(delete);
}
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Handling diversity (1)
ColumnEntity entity = ColumnEntity.of(COLUMN_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)));
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Handling diversity (2)
//mutiple implementation
entityManager.insert(entity);
ColumnQuery query =
select().from(COLUMN_FAMILY).where(ColumnCondition.eq(id)).build();
Optional<ColumnEntity> result = entityManager.singleResult(query);
//cassandra only
List<ColumnEntity> entities = entityManagerCassandra
.cql("select * from newKeySpace.newColumnFamily where id=10;");
entityManagerCassandra.insert(entity, ConsistencyLevel.ALL);
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
JNoSQL - Artemis
— Based on CDI and Diana
— Heavy use of Annotations
— Events on Create, Update, Delete
— BeanValidation Support
— Configurable and Extensible
— “Query by Methods”
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Names & Definitions
— Annotated Entities
— Template
— Repository
— Configuration
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Annotaded Entities
— MappedSuperclass
— Entity
— Column
@Entity(”god")
public class God {
@Column
private String name;
@Column
private Set<God> siblings;
…
}
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Template
import static DocumentQuery.select;
@Inject DocumentTemplate template;
God diana = God.builder().withName(“Diana”);
template.insert(diana);
template.update(diana);
DocumentQuery query =
select().from(“god”).where(“name”).equals(“Diana”).build();
List<God> gods = template.select(query);
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Repository
@Inject
@Database(DatabaseType.COLUMN)
private GodRepository godRepository;
@Inject
@Database(DatabaseType.KEY_VALUE)
private GodRepository godRepository;
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Configuration
[ {
"description": "The couchbase document configuration",
"name": "document",
"provider":
"org.jnosql.diana.couchbase.document.CouchbaseDocumentConfiguration",
"settings": {
"couchbase-host-1": "localhost",
"couchbase-user": "root",
"couchbase-password": "123456"
}
} ]
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Configuration
@Inject
@ConfigurationUnit
private DocumentCollectionManagerFactory<?> entityManager;
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Expansibility
@Entity("person")
public class God {
@Column
private String name;
@UDT(”weapon")
@Column
private Weapon weapon;
}
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Expansibility
interface GodRepository extends CassandraRepository<God> {
@CQL("select * from Person")
List<Person> findAll();
@CQL("select * from Person where name = ?")
List<Person> findByName(String name);
}
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
JNoSQL
Community
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
NoSQL Vendors & Providers
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
JUGs & other communities
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Website
http://jnosql.org
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Mailing List
https://dev.eclipse.org/mailman/listinfo/jnosql-dev
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Repository
https://github.com/JNOSQL/
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Gitter
https://gitter.im/JNOSQL/developers
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Wiki
https://wiki.eclipse.org/JNoSQL
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
? & !
JNoSQL
#JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima
Thanks!

More Related Content

What's hot

Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGNIntroducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Manish Pandit
 
Andrea Lattuada, Gabriele Petronella - Building startups on Scala
Andrea Lattuada, Gabriele Petronella - Building startups on ScalaAndrea Lattuada, Gabriele Petronella - Building startups on Scala
Andrea Lattuada, Gabriele Petronella - Building startups on Scala
Scala Italy
 
Better Front-end Development in Atlassian Plugins
Better Front-end Development in Atlassian PluginsBetter Front-end Development in Atlassian Plugins
Better Front-end Development in Atlassian Plugins
Wojciech Seliga
 
How Scala code is expressed in the JVM
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVM
Koichi Sakata
 
Better front-end development in Atlassian plugins
Better front-end development in Atlassian pluginsBetter front-end development in Atlassian plugins
Better front-end development in Atlassian plugins
Atlassian
 
Scala elegant and exotic part 1
Scala  elegant and exotic part 1Scala  elegant and exotic part 1
Scala elegant and exotic part 1
VulcanMinds
 
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKitAtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
Wojciech Seliga
 
Scala profiling
Scala profilingScala profiling
Scala profiling
Filippo Pacifici
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
scalaconfjp
 
An Introduction to Play 2 Framework
An Introduction to Play 2 FrameworkAn Introduction to Play 2 Framework
An Introduction to Play 2 Framework
PT.JUG
 
Java 201 Intro to Test Driven Development in Java
Java 201   Intro to Test Driven Development in JavaJava 201   Intro to Test Driven Development in Java
Java 201 Intro to Test Driven Development in Java
agorolabs
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
jeresig
 
pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)
Eugene Yokota
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORM
Ortus Solutions, Corp
 
Java 101 Intro to Java Programming - Exercises
Java 101   Intro to Java Programming - ExercisesJava 101   Intro to Java Programming - Exercises
Java 101 Intro to Java Programming - Exercises
agorolabs
 
ITFT - Java Coding
ITFT - Java CodingITFT - Java Coding
ITFT - Java Coding
Blossom Sood
 
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
Stephen Chin
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
Yevgeniy Brikman
 
Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016
takezoe
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
Ryan Cuprak
 

What's hot (20)

Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGNIntroducing Scala to your Ruby/Java Shop : My experiences at IGN
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
 
Andrea Lattuada, Gabriele Petronella - Building startups on Scala
Andrea Lattuada, Gabriele Petronella - Building startups on ScalaAndrea Lattuada, Gabriele Petronella - Building startups on Scala
Andrea Lattuada, Gabriele Petronella - Building startups on Scala
 
Better Front-end Development in Atlassian Plugins
Better Front-end Development in Atlassian PluginsBetter Front-end Development in Atlassian Plugins
Better Front-end Development in Atlassian Plugins
 
How Scala code is expressed in the JVM
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVM
 
Better front-end development in Atlassian plugins
Better front-end development in Atlassian pluginsBetter front-end development in Atlassian plugins
Better front-end development in Atlassian plugins
 
Scala elegant and exotic part 1
Scala  elegant and exotic part 1Scala  elegant and exotic part 1
Scala elegant and exotic part 1
 
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKitAtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
AtlasCamp 2012 - Testing JIRA plugins smarter with TestKit
 
Scala profiling
Scala profilingScala profiling
Scala profiling
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
An Introduction to Play 2 Framework
An Introduction to Play 2 FrameworkAn Introduction to Play 2 Framework
An Introduction to Play 2 Framework
 
Java 201 Intro to Test Driven Development in Java
Java 201   Intro to Test Driven Development in JavaJava 201   Intro to Test Driven Development in Java
Java 201 Intro to Test Driven Development in Java
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
 
pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)pull requests I sent to scala/scala (ny-scala 2019)
pull requests I sent to scala/scala (ny-scala 2019)
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORM
 
Java 101 Intro to Java Programming - Exercises
Java 101   Intro to Java Programming - ExercisesJava 101   Intro to Java Programming - Exercises
Java 101 Intro to Java Programming - Exercises
 
ITFT - Java Coding
ITFT - Java CodingITFT - Java Coding
ITFT - Java Coding
 
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
 
Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016Scala Frameworks for Web Application 2016
Scala Frameworks for Web Application 2016
 
Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
 

Similar to JavaOne 2017 - JNoSQL: The Definitive Solution for Java and NoSQL Database [CON4954]

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]
Otávio Santana
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
Sunghyouk Bae
 
Alternatives of JPA/Hibernate
Alternatives of JPA/HibernateAlternatives of JPA/Hibernate
Alternatives of JPA/Hibernate
Sunghyouk Bae
 
Database Programming Techniques
Database Programming TechniquesDatabase Programming Techniques
Database Programming Techniques
Raji Ghawi
 
Json generation
Json generationJson generation
Json generation
Aravindharamanan S
 
Naver_alternative_to_jpa
Naver_alternative_to_jpaNaver_alternative_to_jpa
Naver_alternative_to_jpa
NAVER Engineering
 
Querydsl fin jug - june 2012
Querydsl   fin jug - june 2012Querydsl   fin jug - june 2012
Querydsl fin jug - june 2012
Timo Westkämper
 
Introduction to Datastore
Introduction to DatastoreIntroduction to Datastore
Introduction to Datastore
Software Park Thailand
 
EJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkEJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLink
Bill Lyons
 
Spring framework part 2
Spring framework part 2Spring framework part 2
Spring framework part 2
Haroon Idrees
 
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 IndiaUsing the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Arun Gupta
 
How to React Native
How to React NativeHow to React Native
How to React Native
Dmitry Ulyanov
 
Easy data-with-spring-data-jpa
Easy data-with-spring-data-jpaEasy data-with-spring-data-jpa
Easy data-with-spring-data-jpa
Staples
 
Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : Datastore
IMC Institute
 
Module Ninja .JS
Module Ninja .JSModule Ninja .JS
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON Binding
Dmitry Kornilov
 
[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps
Ivano Malavolta
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
Thodoris Bais
 
Linq
LinqLinq

Similar to JavaOne 2017 - JNoSQL: The Definitive Solution for Java and NoSQL Database [CON4954] (20)

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]
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
 
Alternatives of JPA/Hibernate
Alternatives of JPA/HibernateAlternatives of JPA/Hibernate
Alternatives of JPA/Hibernate
 
Database Programming Techniques
Database Programming TechniquesDatabase Programming Techniques
Database Programming Techniques
 
Json generation
Json generationJson generation
Json generation
 
Naver_alternative_to_jpa
Naver_alternative_to_jpaNaver_alternative_to_jpa
Naver_alternative_to_jpa
 
Querydsl fin jug - june 2012
Querydsl   fin jug - june 2012Querydsl   fin jug - june 2012
Querydsl fin jug - june 2012
 
Green dao
Green daoGreen dao
Green dao
 
Introduction to Datastore
Introduction to DatastoreIntroduction to Datastore
Introduction to Datastore
 
EJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLinkEJB 3.0 Java Persistence with Oracle TopLink
EJB 3.0 Java Persistence with Oracle TopLink
 
Spring framework part 2
Spring framework part 2Spring framework part 2
Spring framework part 2
 
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 IndiaUsing the latest Java Persistence API 2 Features - Tech Days 2010 India
Using the latest Java Persistence API 2 Features - Tech Days 2010 India
 
How to React Native
How to React NativeHow to React Native
How to React Native
 
Easy data-with-spring-data-jpa
Easy data-with-spring-data-jpaEasy data-with-spring-data-jpa
Easy data-with-spring-data-jpa
 
Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : Datastore
 
Module Ninja .JS
Module Ninja .JSModule Ninja .JS
Module Ninja .JS
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON Binding
 
[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
 
Linq
LinqLinq
Linq
 

More from Leonardo De Moura Rocha Lima

Top 9 mistakes to avoid when developing with NoSQL
Top 9 mistakes to avoid when developing with NoSQLTop 9 mistakes to avoid when developing with NoSQL
Top 9 mistakes to avoid when developing with NoSQL
Leonardo De Moura Rocha Lima
 
Java & IoT
Java & IoTJava & IoT
JSR363 - Devoxx US
JSR363 - Devoxx USJSR363 - Devoxx US
JSR363 - Devoxx US
Leonardo De Moura Rocha Lima
 
IoT Security: Cases and Methods
IoT Security: Cases and MethodsIoT Security: Cases and Methods
IoT Security: Cases and Methods
Leonardo De Moura Rocha Lima
 
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
Leonardo De Moura Rocha Lima
 
Using Java and Standards for Fast IoT Development [CON5513]
Using Java and Standards for Fast IoT Development [CON5513]Using Java and Standards for Fast IoT Development [CON5513]
Using Java and Standards for Fast IoT Development [CON5513]
Leonardo De Moura Rocha Lima
 
IoT Security: Cases and Methods [CON5446]
IoT Security: Cases and Methods [CON5446]IoT Security: Cases and Methods [CON5446]
IoT Security: Cases and Methods [CON5446]
Leonardo De Moura Rocha Lima
 
Secure IoT with Blockchain: Fad or Reality? [BOF5490]
Secure IoT with Blockchain: Fad or Reality? [BOF5490]Secure IoT with Blockchain: Fad or Reality? [BOF5490]
Secure IoT with Blockchain: Fad or Reality? [BOF5490]
Leonardo De Moura Rocha Lima
 
Building a Reliable Remote Communication Device with Java ME8 [CON2285]
Building a Reliable Remote Communication Device with Java ME8 [CON2285]Building a Reliable Remote Communication Device with Java ME8 [CON2285]
Building a Reliable Remote Communication Device with Java ME8 [CON2285]
Leonardo De Moura Rocha Lima
 
A internet das coisas e o futuro - Java ME 8 e adiante!
A internet das coisas e o futuro - Java ME 8 e adiante!A internet das coisas e o futuro - Java ME 8 e adiante!
A internet das coisas e o futuro - Java ME 8 e adiante!
Leonardo De Moura Rocha Lima
 

More from Leonardo De Moura Rocha Lima (10)

Top 9 mistakes to avoid when developing with NoSQL
Top 9 mistakes to avoid when developing with NoSQLTop 9 mistakes to avoid when developing with NoSQL
Top 9 mistakes to avoid when developing with NoSQL
 
Java & IoT
Java & IoTJava & IoT
Java & IoT
 
JSR363 - Devoxx US
JSR363 - Devoxx USJSR363 - Devoxx US
JSR363 - Devoxx US
 
IoT Security: Cases and Methods
IoT Security: Cases and MethodsIoT Security: Cases and Methods
IoT Security: Cases and Methods
 
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
The First IoT JSR: Units of Measurement JSR-363 [BOF5981]
 
Using Java and Standards for Fast IoT Development [CON5513]
Using Java and Standards for Fast IoT Development [CON5513]Using Java and Standards for Fast IoT Development [CON5513]
Using Java and Standards for Fast IoT Development [CON5513]
 
IoT Security: Cases and Methods [CON5446]
IoT Security: Cases and Methods [CON5446]IoT Security: Cases and Methods [CON5446]
IoT Security: Cases and Methods [CON5446]
 
Secure IoT with Blockchain: Fad or Reality? [BOF5490]
Secure IoT with Blockchain: Fad or Reality? [BOF5490]Secure IoT with Blockchain: Fad or Reality? [BOF5490]
Secure IoT with Blockchain: Fad or Reality? [BOF5490]
 
Building a Reliable Remote Communication Device with Java ME8 [CON2285]
Building a Reliable Remote Communication Device with Java ME8 [CON2285]Building a Reliable Remote Communication Device with Java ME8 [CON2285]
Building a Reliable Remote Communication Device with Java ME8 [CON2285]
 
A internet das coisas e o futuro - Java ME 8 e adiante!
A internet das coisas e o futuro - Java ME 8 e adiante!A internet das coisas e o futuro - Java ME 8 e adiante!
A internet das coisas e o futuro - Java ME 8 e adiante!
 

Recently uploaded

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
QADay
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 

JavaOne 2017 - JNoSQL: The Definitive Solution for Java and NoSQL Database [CON4954]

  • 1. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima JNoSQL The Definitive Solution for Java and NoSQL Database Leonardo Lima Otávio Santana
  • 2. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima About the Speakers Leonardo Lima • Computer engineer, server & embedded sw developer • From São Paulo, Brasil, currently in Austin, TX • CTO at V2COM • Spec Lead – JSR363 – Units of Measurement • V2COM’s Representative at JCP Executive Committee [about.me/leomrlima]
  • 3. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Otávio Santana • Software engineer, Tomitribe • From Salvador, Brazil • Java Champion, SouJava JUG Leader • Apache, Eclipse and OpenJDK Committer • Expert Group member in many JSRs • Representative at JCP EC for SouJava About the Speakers
  • 4. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima NoSQL (Not Only SQL)
  • 5. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima What defines NoSQL databases? — No fixed data structure — Not an ACID, but a BASE — Five different types ◦ Key/Value ◦ Column Family ◦ Document ◦ Graph ◦ Multi-Model
  • 6. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima ACID x BASE Basically Available, Soft State, Eventual consistency Atomicity, Consistency, Isolation, Durability
  • 7. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Key/Value — AmazonDynamo — AmazonS3 — Redis — Scalaris — Voldemort — Couchbase — Hazelcast Apollo Sun Aphrodite Love Ares War Light Music Beauty
  • 8. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Row key Column Family — Hbase — Cassandra — Scylla — Clouddata — SimpleDb — DynamoDB Apollo Ares Kratos Duty {”Sun”,“Light”, ”Music”} Duty “War” SlainGods 13 Weapon “Sword”
  • 9. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Document — AmazonSimpleD — Apache CouchDB — Couchbase — MongoDB — Riak { ”name”:”Diana”, ”father”:”Jupiter”, ”mother”:”Latona”, ”siblings”:{ ”name”: ”Apollo” }, ”godOf”: {”Hunt”} }
  • 10. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Graph — Neo4J — InfoGrid — Sones — HyperGraphDB Apollo Ares Kratos
  • 11. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Multi-model — OrientDB ◦ graph, document — Couchbase ◦ key-value, document — Elasticsearch ◦ document, graph — ArangoDB ◦ column family, graph, key-value
  • 12. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima SQL -> NoSQL SQL Key-Value Column Family Document Graph Table Bucket Column Family Collection Row Key/Value pair Column Document Vertex Column Key/Value Pair Key/Value Pair Vertex/Edge properties Relationship Link Edge
  • 13. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Scalability x Complexity Scalability Complexity Key/Value Document Column Family Graph
  • 14. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima NoSQL In Java
  • 15. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima How Java application interact with… SQL NoSQL Logic DAO JPA JDBC JPA JDBC JPA JDBC Logic DAO
  • 16. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima For example: for a Document DB… BaseDocument baseDocument = new BaseDocument(); baseDocument.addAttribute(name, value); JsonObject jsonObject = JsonObject.create(); jsonObject.put(name, value); Document document = new Document(); document.append(name, value); ODocument document = new ODocument(“collection”); document.field(name, value);
  • 17. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima A first attempt on independence… Logic DAO JPA — Hibernate OGM — Eclipse TopLink
  • 18. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima … brings a bunch of issues! — Can’t save asynchronously ◦ No callback — Can’t define aTime to Live (TTL) for stored data — Consistency Level choice on persist — Not all DBs are SQL-based — There are many NoSQL types
  • 19. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima JNoSQL
  • 20. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima What is JNoSQL? — Mapping API - Artemis — Communication API - Diana — No lock-in — Divide and conquer DAO Communication Mapping JNoSQL
  • 21. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Eclipse JNoSQL — Eclipse Foundation — Apache v2 + EPL 1.0 — API to each NoSQL type — Configurable — Extensible Communication Mapping
  • 22. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima JNoSQL - Diana — Communication layer API — One API for each DB type ◦ Document ◦ Key-value ◦ Column ◦ Graph
  • 23. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima JNoSQL – Diana APIs Key/Value Document Column Family Graph
  • 24. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Back to that Document DB… DocumentEntity entity = DocumentEntity.of("documentCollection"); Document document = Document.of(name, value); entity.add(document);
  • 25. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Names & Definitions — Configuration — Factory — Manager — Entity
  • 26. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Names & Definitions ColumnConfiguration<?> condition = new DriverConfiguration(); try(ColumnFamilyManagerFactory managerFactory = condition.get()) { ColumnFamilyManager entityManager = managerFactory.get(KEY_SPACE); entityManager.insert(entity); ColumnQuery select = select().from(COLUMN_FAMILY).where(eq(id)).build(); ColumnDeleteQuery delete = delete().from(COLUMN_FAMILY) .where(eq(id)).build(); Optional<ColumnEntity> result = entityManager.singleResult(query); entityManager.delete(delete); }
  • 27. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Handling diversity (1) ColumnEntity entity = ColumnEntity.of(COLUMN_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)));
  • 28. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Handling diversity (2) //mutiple implementation entityManager.insert(entity); ColumnQuery query = select().from(COLUMN_FAMILY).where(ColumnCondition.eq(id)).build(); Optional<ColumnEntity> result = entityManager.singleResult(query); //cassandra only List<ColumnEntity> entities = entityManagerCassandra .cql("select * from newKeySpace.newColumnFamily where id=10;"); entityManagerCassandra.insert(entity, ConsistencyLevel.ALL);
  • 29. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima JNoSQL - Artemis — Based on CDI and Diana — Heavy use of Annotations — Events on Create, Update, Delete — BeanValidation Support — Configurable and Extensible — “Query by Methods”
  • 30. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Names & Definitions — Annotated Entities — Template — Repository — Configuration
  • 31. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Annotaded Entities — MappedSuperclass — Entity — Column @Entity(”god") public class God { @Column private String name; @Column private Set<God> siblings; … }
  • 32. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Template import static DocumentQuery.select; @Inject DocumentTemplate template; God diana = God.builder().withName(“Diana”); template.insert(diana); template.update(diana); DocumentQuery query = select().from(“god”).where(“name”).equals(“Diana”).build(); List<God> gods = template.select(query);
  • 33. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Repository @Inject @Database(DatabaseType.COLUMN) private GodRepository godRepository; @Inject @Database(DatabaseType.KEY_VALUE) private GodRepository godRepository;
  • 34. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Configuration [ { "description": "The couchbase document configuration", "name": "document", "provider": "org.jnosql.diana.couchbase.document.CouchbaseDocumentConfiguration", "settings": { "couchbase-host-1": "localhost", "couchbase-user": "root", "couchbase-password": "123456" } } ]
  • 35. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Configuration @Inject @ConfigurationUnit private DocumentCollectionManagerFactory<?> entityManager;
  • 36. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Expansibility @Entity("person") public class God { @Column private String name; @UDT(”weapon") @Column private Weapon weapon; }
  • 37. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Expansibility interface GodRepository extends CassandraRepository<God> { @CQL("select * from Person") List<Person> findAll(); @CQL("select * from Person where name = ?") List<Person> findByName(String name); }
  • 38. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima JNoSQL Community
  • 39. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima NoSQL Vendors & Providers
  • 40. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima JUGs & other communities
  • 41. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Website http://jnosql.org
  • 42. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Mailing List https://dev.eclipse.org/mailman/listinfo/jnosql-dev
  • 43. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Repository https://github.com/JNOSQL/
  • 44. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Gitter https://gitter.im/JNOSQL/developers
  • 45. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Wiki https://wiki.eclipse.org/JNoSQL
  • 46. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima ? & !
  • 47. JNoSQL #JavaOne #JNoSQL @JNoSQL @otaviojava @leomrlima Thanks!