SlideShare a Scribd company logo
NoSQL Endgame
Otávio Santana
Platform.sh
Thodoris Bais
ABN Amro & Utrecht JUG
Werner Keil
CATMedia
21-23 December 2020 #Virtual
Werner Keil Thodoris Bais
Jakarta EE Specification Committee Member
Let’s meet
@thodorisbais@wernerkeil
Jakarta EE Ambassador, EG Member JSR-385
Otavio Santana
Developer Relations Engineer, Platform.sh
Let’s meet
@otaviojava
4
5 trends in 2020
New digital trends create new technical
challenges
@thodorisbais@wernerkeil @otaviojava
• Develop with agility
• Operate at any scale
• Deliver the performance and
availability required to meet the
demands of Digital Economy
businesses
What are the technical challenges?
7
• Handle large volumes of data at high-speed with a scale-out architecture
• Store unstructured, semi-structured, or structured data
• Enable easy updates to schemas and fields
• Developer-friendly
• Take full advantage of the cloud to deliver zero downtime
Advantages of NoSQL
Why this talk
Tons of persistence frameworks
Which one performs best for your case?
JVM can cope with heavy loads
Would normally take ages to
compare
NoSQL
01 Database
02 Doesn't use structure
03 Not Transaction
04 Base
Four different types05
Key-Value stores
AmazonS3
Apollo
Ares
Aphrodite
Sun
War
Love Beauty
AmazonDynamo
Hazelcast
Redis
Column-Oriented
Apollo
Aphrodite
Ares
Kratos
Duty
Duty
Duty
Dead Gods
Love, happy
Sun
War
13
Color
weapon
Sword
Row-key ColumnsHBase
Scylla
SimpleDB
Cassandra
DynamoDB
Clouddata
Document stores
{
"name":"Diana",
"duty":[
"Hunt",
"Moon",
"Nature"
],
"siblings":{
"Apollo":"brother"
}
}
ApacheCouchDB
MongoDB
Couchbase
Graph databases
Apollo Ares
Kratos
was killed by was killed by
killed killed
Neo4j
InfoGrid
Sones
HyperGraphDB
Multi-Model
01
02
03
04
OrientDB (graph, document)
Couchbase (key value, document)
Elasticsearch (document, graph)
ArangoDB (document, graph, key-value)
SQL vs NoSQL
SQL KEY-VALUE COLUMN DOCUMENTS GRAPH
Table Bucket Column family Collection
Row Key/value pair Column Documents Vertex
Column Key/value pair Key/value pair Vertex and
Edge property
Relationship Link Edge
BASE vs ACID
• Basically Available
• Soft state
• Eventual consistency
• Atomicity
• Consistency
• Isolation
• Durability
CAP
Scalability vs Complexity
Scalability
Complexity
key-value
Column
Document
Graph
Relational Application NoSQL Application
Logic Tier Logic Tier
DAO DAO
JPAJPAJPAJPA
JDBC JDBCJDBCJDBC
Data Tier
APIAPI API
Data Tier
Our comparison model
JPA problem for NoSQL
01
02
03
04
05
06
Saves Async
Async Callback
Time to Live (TTL)
Consistency Level
SQL based
Diversity in NoSQL
Annotated Entities
01
02
03
Mapped Superclass
Entity
Column
@Entity("god")
public class God {
@Column
private String name;
@Column
private long age;
@Column
private Set<String> powers;
}
Template
God artemis = ...;
DocumentTemplate template = …
template.insert(artemis);
template.update(artemis);
DocumentQuery query = ...
List<God> gods = template.select(query);
Repository
interface GodRepository extends MongoRepository<God, String> {
List<God> findByNameAndAge (String name, Integer age);
}
Repository
public interface MovieRepository extends
ReactiveNeo4jRepository<MovieEntity, String> {
Mono<MovieEntity> findOneByTitle(String title);
}
Entities
@Node("Person")
public class PersonEntity {
@Id
private final String name;
private final Integer born;
}
@Node("Movie")
public class MovieEntity {
@Id
private final String title;
@Property("tagline")
private final String description;
@Relationship(type = "ACTED_IN", direction = INCOMING)
private Map<PersonEntity, Roles> actorsAndRoles =
new HashMap<>();
@Relationship(type = "DIRECTED", direction = INCOMING)
private List<PersonEntity> directors = new ArrayList<>();
}
Relationships
@RelationshipProperties
public class Roles {
private final List<String> roles;
public Roles(List<String> roles) {
this.roles = roles;
}
}
@Document(collection = "gods")
public class God { … }
interface GodRepository extends
MongoRepository<God, String> { … }
What about the Controller?
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
spring.data.mongodb.database=mythology
spring.data.mongodb.port=27017
Logistics Domain
Our example
MovieEntity
MovieRepository
PersonEntity
Roles
…
Other reactive dependencies
…
<dependency>
<groupId>org.neo4j.springframework.data</groupId>
<artifactId>spring-data-neo4j-rx-spring-boot-starter</artifactId>
<version>1.1.1</version>
</dependency>
org.neo4j.driver.uri=bolt://localhost:7687
org.neo4j.driver.authentication.username=neo4j
org.neo4j.driver.authentication.password=secret
Logistics Domain
Demo Time
@thodorisbais@wernerkeil @otaviojava
Repository
@Inject
@Database(DatabaseType.COLUMN)
private GodRepository godRepository;
@Inject
@Database(DatabaseType.KEY_VALUE)
private GodRepository godRepository;
Repository with Queries
interface PersonRepository extends Repository<Person, Long> {
@Query("select * from Person")
Optional<Person> findByQuery();
@Query("select * from Person where id = @id")
Optional<Person> findByQuery(@Param("id") String id);
}
Diversity
@Entity("god")
public class God {
@Column
private String name;
@UDT("weapon")
@Column
private Weapon weapon;
}
interface GodRepository extends
CassandraRepository<God, String> {
@CQL("select * from God where name = ?")
List<God> findByName(String name);
}
List<Movie> movies = documentTemplate.query("select * from Movie
where year > 2012");
List<Person> people = columnTemplate.query("select * from Person
where age = 25");
Optional<God> god = keyValueTemplate.query("get 'Ullr'");
List<City> cities = graphTemplate.query("g.V().hasLabel('City')");
Query by Text
Micronaut Data
NoSQL?
Repository
public class AnimalRepository {
List<Animal> findByType(String type) {…}
public Animal insert(Animal animal) {…}
}
Entity
public class City {
private String name;
public City(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
Query by Text
public void save(City city) {
try (Session s = driver.session()) {
String statement = "MERGE (c:City {id:$name.id}) ON CREATE SET c+=$name";
s.writeTransaction(tx -> tx.run(statement, singletonMap("name" ,city.asMap())));
}
}
public Stream<City> findByName(String name) {
try (Session s = driver.session()) {
String statement = "MATCH (c:City) WHERE c.name contains $name RETURN c";
return s.readTransaction(tx -> tx.run(statement, singletonMap("name", name)))
.list(record -> new City(record.get("c").asMap())).stream();
}
}
GORM
NoSQL?
Entity
@Entity
class User {
ObjectId id
String emailAddress
String password
String fullname
Date dateCreated
Date lastUpdated
static constraints = {
emailAddress email: true
password nullable: true
fullname blank: false
}
}}
What happened to
?
Entity
@Entity(”Editor")
public class Editor {
@Id
private String editor;
private String editorName;
@OneToMany(mappedBy = “editor”, cascade = PERSIST)
private Set<Author> assignedAuthors = new HashSet<>();
// constructors, getters, setters…
}
Operations
Warning
“In most cases, multi-document transaction incurs a greater
performance cost over single document writes, and the availability of
multi-document transactions should not be a replacement for
effective schema design. For many scenarios, the denormalized data
model (embedded documents and arrays) will continue to be optimal
for your data and use cases. That is, for many scenarios, modeling
your data appropriately will minimize the need for multi-document
transactions.”
Documentation
Entity
@Entity(name = "book")
@Indexed
@Analyzer(impl = StandardAnalyzer.class)
public class Book {
@Id
@DocumentId
private Long isbn;
@Column
@Field(analyze = Analyze.NO)
private String name;
@Column
@Field
private String author;
@Column
@Field
private String category;
}
Operations
EntityManagerFactory managerFactory = Persistence.createEntityManagerFactory("hibernate");
EntityManager manager = managerFactory.createEntityManager();
manager.getTransaction().begin();
Book cleanCode = getBook(1L, "Clean Code", "Robert Cecil Martin");
manager.merge(cleanCode);
manager.getTransaction().commit();
Book book = manager.find(Book.class, 1L);
Warning
“Cassandra does not use RDBMS ACID transactions with
rollback or locking mechanisms...
As a non-relational database, Cassandra does not support joins
or foreign keys, and consequently does not offer consistency in
the ACID sense.”
DataStax Documentation
Conclusions
@thodorisbais@wernerkeil @otaviojava
Conclusions
Still in Progress ❌
Supports a huge number of NoSQL
database systems
✅
Loosely coupled code makes switching between
different NoSQL vendors just a matter of configuration
✅
Removes boiler-plate code and
provides a cleaner, more readable DAO
✅
Conclusions
Switching between different NoSQL
vendors not so easy
❌
Micronaut Data does not support NoSQL
databases yet
❌
Still in Progress ❌
Often faster with a lower footprint and polyglot
language support for Java, Kotlin and Groovy
✅
Conclusions
Provides a cleaner and more readable DAO
implementation
✅
Works with Grails, Micronaut or Spring Boot, polyglot
language support for Java and Groovy
✅
Removes a lot of boiler-plate code ✅
Only 3 to 4 of the most popular NoSQL databases are supported
out of the box, others require more effort or won’t work yet ❌
Conclusions
Provides a cleaner and more readable DAO
implementation
✅
Loosely coupled code makes switching between
different NoSQL vendors just a matter of configuration
✅
Removes a lot of boiler-plate code ✅
Only half a dozen popular NoSQL databases are supported out of
the box, others require more effort or won’t work yet ❌
Conclusions
Using a mapper for all scenarios is not a
recommended approach
❌
Some JPA concepts are not easily mapped to
the NoSQL world (e.g. transactions)
❌
No error-safe way to run the query language and hydrate DTOs
from the result ❌
Outdated, no release since 2018 ❌
▪ GitHub repositories
▪ https://github.com/JNOSQL/nosql-endgame
▪ Project page
▪ http://jnosql.org
@thodorisbais@wernerkeil
Links
5
6
• Flaticon.com
• Michael Simons
• Jean Tessier
Credits
@thodorisbais@wernerkeil
Thank You !
@thodorisbais@wernerkeil @otaviojava

More Related Content

What's hot (19)

PPTX
Map-Reduce and Apache Hadoop
Svetlin Nakov
 
PPTX
04 spark-pair rdd-rdd-persistence
Venkat Datla
 
PDF
Geneva JUG - Cassandra for Java Developers
Michaël Figuière
 
PDF
Thunderstruck
wagnerandrade
 
PPTX
Making Modern Websites
Patrick Kettner
 
PDF
Domain Driven Design
Pascal Larocque
 
PDF
Better than you think: Handling JSON data in ClickHouse
Altinity Ltd
 
PDF
MongoDB @ Frankfurt NoSql User Group
Chris Harris
 
PPTX
Oracle 10g
Svetlin Nakov
 
KEY
Data perisistence in iOS
mobiledeveloperpl
 
PPTX
Entity Framework: Nakov @ BFU Hackhaton 2015
Svetlin Nakov
 
ODP
MongoDB - A Document NoSQL Database
Ruben Inoto Soto
 
PDF
Http4s, Doobie and Circe: The Functional Web Stack
GaryCoady
 
PDF
Building modular monoliths that could scale to microservices (only if they ne...
David Gómez García
 
PDF
Works with persistent graphs using OrientDB
graphdevroom
 
PPTX
Mongo db – document oriented database
Wojciech Sznapka
 
PDF
Heroku Postgres Cloud Database Webinar
Salesforce Developers
 
PPTX
Morphia, Spring Data & Co.
Tobias Trelle
 
Map-Reduce and Apache Hadoop
Svetlin Nakov
 
04 spark-pair rdd-rdd-persistence
Venkat Datla
 
Geneva JUG - Cassandra for Java Developers
Michaël Figuière
 
Thunderstruck
wagnerandrade
 
Making Modern Websites
Patrick Kettner
 
Domain Driven Design
Pascal Larocque
 
Better than you think: Handling JSON data in ClickHouse
Altinity Ltd
 
MongoDB @ Frankfurt NoSql User Group
Chris Harris
 
Oracle 10g
Svetlin Nakov
 
Data perisistence in iOS
mobiledeveloperpl
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Svetlin Nakov
 
MongoDB - A Document NoSQL Database
Ruben Inoto Soto
 
Http4s, Doobie and Circe: The Functional Web Stack
GaryCoady
 
Building modular monoliths that could scale to microservices (only if they ne...
David Gómez García
 
Works with persistent graphs using OrientDB
graphdevroom
 
Mongo db – document oriented database
Wojciech Sznapka
 
Heroku Postgres Cloud Database Webinar
Salesforce Developers
 
Morphia, Spring Data & Co.
Tobias Trelle
 

Similar to NoSQL Endgame - Java2Days 2020 Virtual (20)

PPTX
NoSQL Endgame LWJUG 2021
Thodoris Bais
 
PPTX
EclipseCon 2021 NoSQL Endgame
Thodoris Bais
 
PPTX
NoSQL Endgame JCON Conference 2020
Thodoris Bais
 
PPTX
JakartaData-JCon.pptx
EmilyJiang23
 
PDF
JavaOne 2017 - JNoSQL: The Definitive Solution for Java and NoSQL Database [C...
Leonardo De Moura Rocha Lima
 
PDF
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Otávio Santana
 
PDF
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
DATAVERSITY
 
PPTX
NoSQL: The first New Jakarta EE Specification (DWX 2019)
Werner Keil
 
PPTX
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Werner Keil
 
PDF
Grails and Neo4j
darthvader42
 
PDF
GR8Conf 2011: Neo4j Plugin
GR8Conf
 
PPTX
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
tdc-globalcode
 
PDF
NoSQL, no Limits, lots of Fun!
Otávio Santana
 
PPTX
Big data technology unit 3
RojaT4
 
PDF
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Otávio Santana
 
PDF
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
Shaun Smith
 
PPTX
Polyglot Persistence
Bryan Reinero
 
PDF
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Otávio Santana
 
PPTX
Neo4 + Grails
stasimus
 
PDF
Json within a relational database
Dave Stokes
 
NoSQL Endgame LWJUG 2021
Thodoris Bais
 
EclipseCon 2021 NoSQL Endgame
Thodoris Bais
 
NoSQL Endgame JCON Conference 2020
Thodoris Bais
 
JakartaData-JCon.pptx
EmilyJiang23
 
JavaOne 2017 - JNoSQL: The Definitive Solution for Java and NoSQL Database [C...
Leonardo De Moura Rocha Lima
 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Otávio Santana
 
Leveraging your Knowledge of ORM Towards Performance-based NoSQL Technology
DATAVERSITY
 
NoSQL: The first New Jakarta EE Specification (DWX 2019)
Werner Keil
 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Databases
Werner Keil
 
Grails and Neo4j
darthvader42
 
GR8Conf 2011: Neo4j Plugin
GR8Conf
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
tdc-globalcode
 
NoSQL, no Limits, lots of Fun!
Otávio Santana
 
Big data technology unit 3
RojaT4
 
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Otávio Santana
 
EclipseLink: Beyond Relational and NoSQL to Polyglot and HTML5
Shaun Smith
 
Polyglot Persistence
Bryan Reinero
 
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Otávio Santana
 
Neo4 + Grails
stasimus
 
Json within a relational database
Dave Stokes
 
Ad

More from Werner Keil (20)

PPTX
Securing eHealth, eGovernment and eBanking with Java - DWX '21
Werner Keil
 
PPTX
OpenDDR and Jakarta MVC - JavaLand 2021
Werner Keil
 
PPTX
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
Werner Keil
 
PPTX
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual
Werner Keil
 
PPTX
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR
Werner Keil
 
PPTX
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
Werner Keil
 
PPTX
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
Werner Keil
 
PPTX
Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Werner Keil
 
PPTX
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
Werner Keil
 
PPTX
JNoSQL: The Definitive Solution for Java and NoSQL Databases
Werner Keil
 
PPTX
Physikal - Using Kotlin for Clean Energy - KUG Munich
Werner Keil
 
PPTX
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Werner Keil
 
PPTX
Performance Monitoring for the Cloud - Java2Days 2017
Werner Keil
 
PPTX
Eclipse Science F2F 2016 - JSR 363
Werner Keil
 
PPTX
Java2Days - Security for JavaEE and the Cloud
Werner Keil
 
PPTX
Apache DeviceMap - Web-Dev-BBQ Stuttgart
Werner Keil
 
PPTX
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
Werner Keil
 
PPTX
JSR 354: Money and Currency API - Short Overview
Werner Keil
 
PPTX
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
Werner Keil
 
PPTX
Enterprise 2.0 with Open Source Frameworks like Agorava
Werner Keil
 
Securing eHealth, eGovernment and eBanking with Java - DWX '21
Werner Keil
 
OpenDDR and Jakarta MVC - JavaLand 2021
Werner Keil
 
How JSR 385 could have Saved the Mars Climate Orbiter - Zurich IoT Day 2021
Werner Keil
 
OpenDDR and Jakarta MVC - Java2Days 2020 Virtual
Werner Keil
 
JCON 2020: Mobile Java Web Applications with MVC and OpenDDR
Werner Keil
 
How JSR 385 could have Saved the Mars Climate Orbiter - JFokus 2020
Werner Keil
 
Money, Money, Money, can be funny with JSR 354 (Devoxx BE)
Werner Keil
 
Money, Money, Money, can be funny with JSR 354 (DWX 2019)
Werner Keil
 
How JSR 385 could have Saved the Mars Climate Orbiter - Adopt-a-JSR Day
Werner Keil
 
JNoSQL: The Definitive Solution for Java and NoSQL Databases
Werner Keil
 
Physikal - Using Kotlin for Clean Energy - KUG Munich
Werner Keil
 
Physikal - JSR 363 and Kotlin for Clean Energy - Java2Days 2017
Werner Keil
 
Performance Monitoring for the Cloud - Java2Days 2017
Werner Keil
 
Eclipse Science F2F 2016 - JSR 363
Werner Keil
 
Java2Days - Security for JavaEE and the Cloud
Werner Keil
 
Apache DeviceMap - Web-Dev-BBQ Stuttgart
Werner Keil
 
The First IoT JSR: Units of Measurement - JUG Berlin-Brandenburg
Werner Keil
 
JSR 354: Money and Currency API - Short Overview
Werner Keil
 
JavaLand: Quantified Social - Fitness-Geräte und -Portale mit Agorava
Werner Keil
 
Enterprise 2.0 with Open Source Frameworks like Agorava
Werner Keil
 
Ad

Recently uploaded (20)

PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
July Patch Tuesday
Ivanti
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Python basic programing language for automation
DanialHabibi2
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 

NoSQL Endgame - Java2Days 2020 Virtual