SlideShare a Scribd company logo
Polyglot Persistence
Otávio Santana
@otaviojava
otaviojava@apache.org
NoSQL
● Database
● Doesn't use structure
● Not Transaction
● BASE
● Five different types
Key Value
● AmazonDynamo
● AmazonS3
● Redis
● Hazelcast
SunApollo
WarAres
LoveAphrodite Beaty
Column Family
● Hbase
● Cassandra
● Scylla
● Clouddata
● SimpleDb
● DynamoDB
Row-key Columns...
Apollo
Aphrodite
Ares
Sun
Duty
{Love, happy}
Duty
War
Duty
Sword
weapon
Color
Kratos
Dead Gods
13
Document
● ApacheCouchDB
● MongoDB
● Riak
● Couchbase
{
"name":"Diana",
"duty":[
"Hunt",
"Moon",
"Nature"
],
"siblings":{
"Apollo":"brother"
}
}
Graph
● Neo4j
● InfoGrid
● Sones
● HyperGraphDB
Apollo Ares
Kratoswas killed by was killed by
Is brother
killed killed
Multi-Model
● OrientDB (graph, document)
● Couchbase (key value,
document)
● Elasticsearch (document, graph)
● ArangoDB (column family,
graph, key-value)
SQL Key-value Column Document Graph
Table Bucket Column
Family
Collection
Row Key/value
pair
Column Document Vertex
Column Key/value
pair
Key/value pair Vertex and Edge
property
Relationship Link Edge
SQL vs NoSQL
BASE vs ACID
● Basically Available
● Soft state
● Eventual consistency
● Atomicity
● Consistency
● Isolation
● Durability
CAP
Scalability vs Complexity
S
c
a
l
a
b
i
l
i
t
y Complexity
key-value
Column
Document
Graph
KISS
● Avoid complexity
● Product First
● MVP
● Baby Step
Our database
is too slow and
not big enough!
We need
NoSql!
SQL
● know-who
● know-why
● General
SQL
● Explain
● Compose
● Index
● Model
Emulate
● ACID
● Replica
● Duplicate
Model
Validation
● Test
● Migration
● TTL
Diversity
● Types
● Unique
● Configuration
Slow
● Index
● Wildcard
Search Engine
● Analyzers
● Character filter
● Tokenizer
● Token filter
Search Engine
Character
filter
Tokenizer
Token
filter
Commandm
ents
1. Keep it simple
2. Don't follow the Hype
3. SQL still in shape
4. Understand NoSQL
5. Don't trust in Benchmarks
6. Never emulate
7. Models are differents
8. Improving tests
9. Diversity
10. Search Engine
JNoSQL
● Mapping API
● Communication API
● No lock-in
● Divide and conquer
DAO
Mapping
Communication
Document
Key
Column
Graph
DIANA
ARTEMIS
JNoSQL
Data Tier
Communication Issue
ODocument document = new
ODocument(“collection”);
document.field(name, value);
JsonObject jsonObject = JsonObject.create();
jsonObject.put(name, value);
BaseDocument baseDocument = new
BaseDocument();
baseDocument.addAttribute(name, value);
Document document = new Document();
document.append(name, value);
Communication Issue
ODocument document = new
ODocument(“collection”);
document.field(name, value);
JsonObject jsonObject = JsonObject.create();
jsonObject.put(name, value);
BaseDocument baseDocument = new
BaseDocument();
baseDocument.addAttribute(name, value);
Document document = new Document();
document.append(name, value);
Communication Issue
DocumentEntity entity =
DocumentEntity.of("documentCollection");
Document document = Document.of(name, value);
entity.add(document);
Diversity
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)));
//mutiple implementation
columnEntityManager.save(entity);
ColumnQuery query =
select().from(COLUMN_FAMILY).where("id").eq(10L).build();
Optional<ColumnEntity> result = columnEntityManager.singleResult(query);
//cassandra only
List<ColumnEntity> entities = columnEntityManagerCassandra
.cql("select * from newKeySpace.newColumnFamily where id=10;");
columnEntityManagerCassandra.insert(entity, ConsistencyLevel.ALL);
Thank you
Otávio Santana
@otaviojava
osantana@tomitribe.com
otaviojava@apache.org

More Related Content

PDF
NoSQL, no Limits, lots of Fun!
PPTX
Scaling Analytics with elasticsearch
PPTX
NoSQL Roundup
PDF
Using elasticsearch with rails
PPTX
SPIN and Shapes
PPTX
An introduction to Nosql
PDF
Building a spa_in_30min
PPTX
Elastic Search
NoSQL, no Limits, lots of Fun!
Scaling Analytics with elasticsearch
NoSQL Roundup
Using elasticsearch with rails
SPIN and Shapes
An introduction to Nosql
Building a spa_in_30min
Elastic Search

What's hot (19)

PDF
Jakarta EE Meets NoSQL at the Cloud Age
PDF
Introduction to Elasticsearch
PPTX
How to scale relational (OLTP) databases. Think: Sharding @C16LV
PDF
Simple search with elastic search
PPSX
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
PPTX
An Introduction to Elastic Search.
PPT
Elastic search apache_solr
ODP
Cool bonsai cool - an introduction to ElasticSearch
PPTX
SHACL Specification Draft
PPTX
BigData, NoSQL & ElasticSearch
PDF
ElasticSearch - index server used as a document database
KEY
NoSQL: Why, When, and How
PDF
Elasticsearch in 15 minutes
KEY
Modeling Data in MongoDB
PDF
Rupy2012 ArangoDB Workshop Part2
PPTX
Solr vs. Elasticsearch - Case by Case
PPTX
473_LightningTalks.pptx
PPTX
Philly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
Jakarta EE Meets NoSQL at the Cloud Age
Introduction to Elasticsearch
How to scale relational (OLTP) databases. Think: Sharding @C16LV
Simple search with elastic search
What I learnt: Elastic search & Kibana : introduction, installtion & configur...
An Introduction to Elastic Search.
Elastic search apache_solr
Cool bonsai cool - an introduction to ElasticSearch
SHACL Specification Draft
BigData, NoSQL & ElasticSearch
ElasticSearch - index server used as a document database
NoSQL: Why, When, and How
Elasticsearch in 15 minutes
Modeling Data in MongoDB
Rupy2012 ArangoDB Workshop Part2
Solr vs. Elasticsearch - Case by Case
473_LightningTalks.pptx
Philly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
Ad

Similar to Polyglot persistence (20)

PPTX
«NoSQL Databases and Polyglot Persistence»
PDF
Charlotte Software Engineering Meetup - Jan.2015
PPTX
No sqlpresentation
PDF
Eclipse JNoSQL updates from JCP September 11
PDF
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
PDF
Palestra Java + NoSQL = Iniciativa JNoSQL no TDC Florianópolis
PDF
BDA UNIT5.pdf
 
PPTX
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
PPTX
NoSQL powerpoint presentation difference with rdbms
PPTX
Introduction to no sql database
PDF
Polyglot Persistence - Two Great Tastes That Taste Great Together
PPTX
Choosing your NoSQL storage
PDF
Solr cloud the 'search first' nosql database extended deep dive
PPTX
Why does Microsoft care about NoSQL, SQL and Polyglot Persistence?
PPTX
EclipseCon 2021 NoSQL Endgame
PPTX
unit2-ppt1.pptx
PPTX
No SQL DATABASE Description about 4 no sql database.pptx
PDF
EclipseLink: From NoSQL to HTML5 by Shaun Smith
PDF
No sql bigdata and postgresql
PDF
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
«NoSQL Databases and Polyglot Persistence»
Charlotte Software Engineering Meetup - Jan.2015
No sqlpresentation
Eclipse JNoSQL updates from JCP September 11
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
Palestra Java + NoSQL = Iniciativa JNoSQL no TDC Florianópolis
BDA UNIT5.pdf
 
TDC2017 | Florianopolis - Trilha DevOps How we figured out we had a SRE team ...
NoSQL powerpoint presentation difference with rdbms
Introduction to no sql database
Polyglot Persistence - Two Great Tastes That Taste Great Together
Choosing your NoSQL storage
Solr cloud the 'search first' nosql database extended deep dive
Why does Microsoft care about NoSQL, SQL and Polyglot Persistence?
EclipseCon 2021 NoSQL Endgame
unit2-ppt1.pptx
No SQL DATABASE Description about 4 no sql database.pptx
EclipseLink: From NoSQL to HTML5 by Shaun Smith
No sql bigdata and postgresql
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Ad

More from Otávio Santana (20)

PDF
NoSQL design pitfalls with Java
PDF
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
PDF
Architecting Cloud Computing Solutions with Java [1.1]
PDF
Arquitetando soluções de computação em nuvem com Java
PDF
Build, run, and scale your Java applications end to end
PDF
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
PDF
ORMs: Heroes or Villains Inside the Architecture?
PDF
Boost your APIs with GraphQL 1.0
PDF
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
PDF
Let’s Make Graph Databases Fun Again with Java [DEV6043]
PDF
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
PDF
The new generation of data persistence with graph
PDF
Stateless Microservice Security via JWT and MicroProfile - Guatemala
PDF
Stateless Microservice Security via JWT and MicroProfile - Mexico
PDF
Management 3.0 and open source
PDF
Building a Recommendation Engine with Java EE
PDF
Cassandra NoSQL, NoLimits!
PDF
Disasters of the century NoSQL
PDF
Building a recommendation engine with tinker pop
PDF
MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...
NoSQL design pitfalls with Java
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Architecting Cloud Computing Solutions with Java [1.1]
Arquitetando soluções de computação em nuvem com Java
Build, run, and scale your Java applications end to end
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
ORMs: Heroes or Villains Inside the Architecture?
Boost your APIs with GraphQL 1.0
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Let’s Make Graph Databases Fun Again with Java [DEV6043]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
The new generation of data persistence with graph
Stateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - Mexico
Management 3.0 and open source
Building a Recommendation Engine with Java EE
Cassandra NoSQL, NoLimits!
Disasters of the century NoSQL
Building a recommendation engine with tinker pop
MicroProfile: uma nova forma de desenvolver aplicações corporativas na era do...

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Getting Started with Data Integration: FME Form 101
PDF
August Patch Tuesday
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Mushroom cultivation and it's methods.pdf
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
project resource management chapter-09.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
1. Introduction to Computer Programming.pptx
A Presentation on Artificial Intelligence
Assigned Numbers - 2025 - Bluetooth® Document
Getting Started with Data Integration: FME Form 101
August Patch Tuesday
cloud_computing_Infrastucture_as_cloud_p
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Mushroom cultivation and it's methods.pdf
TLE Review Electricity (Electricity).pptx
Tartificialntelligence_presentation.pptx
A comparative analysis of optical character recognition models for extracting...
NewMind AI Weekly Chronicles - August'25-Week II
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
project resource management chapter-09.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Hindi spoken digit analysis for native and non-native speakers
Univ-Connecticut-ChatGPT-Presentaion.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
1. Introduction to Computer Programming.pptx

Polyglot persistence