38
Let's talk about NoSQL Standard Otávio Santana @otaviojava

Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

  • Upload
    lamque

  • View
    224

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Let's talk about NoSQL Standard

Otávio Santana@otaviojava

Page 2: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

NoSQL

● Database● Doesn't use relationship● BASE● Five types

Page 3: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Key Value

● AmazonDynamo● AmazonS3● Redis● Scalaris● Voldemort ● Couchbase

valuekey

valuekey

valuekey

Page 4: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Key Value

Table Bucket

Row Key/value pair

Column ---

Relationship ---

● American Express● AT&T● Bank of America

Page 5: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Document

● AmazonSimpleD● ApacheCouchdb● MongoDb● Riak● Couchbase

Page 6: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Document

Table Collection

Row Document

Column Key/value pair

Relationship Link

● MetLife● BuzzFeed● Ebay

Page 7: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Column

● Hbase● Cassandra● Scylla● Clouddata● SimpleDb● DynamoDB

Row-key Columns...

Apollo

Aphrodite

Ares

SunDuty

{Love, happy}Duty

WarDuty

Swordweapon

Color

Kratos

Dead Gods13

Page 8: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Column

● Github● Netflix● Reddit

Table Column Family

Row Column

Column Key/value pair

Relationship Not supported

Page 9: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Graph

● Neo4j● InfoGrid● Sones● HyperGraphDB

Apollo Ares

Kratos

was dead was dead

Is brother

killed killed

Page 10: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Graph

● Walmart● InfoJobs● Linkedin

Table Vertex and Edge

Row Vetex

Column Vertex and Edge property

Relationship Edge

Page 11: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Multi-model

● OrientDB● Couchbase● Elasticsearch● Cassandra

Page 12: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

The Problem

Page 13: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

The Problem

Page 14: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

The Current solution

● Spring Data● Hibernate OGM● TopLink

Page 15: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

JPA problem

● Saves Async● Async Callback● TTL● Consistency Level● SQL based● Diversity in NoSQL

Page 16: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

The Challenge

● 4 Types● Differents behaviors● Differents goals

Page 17: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

The Solution

● SPI ● Communication● No lock-in● Split problems

Page 18: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

JNoSQL

● Several tools to make easy an integration between the Java Application with the NoSQL.

● Communication API● Abstraction API

Page 19: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Diana

● API Communication layer● Document, key-value, Column,

Graph● Universal Adapter● Standard

Page 20: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

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.

Page 21: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Diana Project

● Commons API● Document API● Graph API● Key-value API● Column API● Four TCKs

Page 22: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Diana Project

Page 23: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Nomenclature

● Configuration● Factory● Manager● Entity● Value

Page 24: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

DiversityColumnEntity 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)));

//both implementationcolumnEntityManager.save(entity);ColumnQuery query = ColumnQuery.of(COLUMN_FAMILY);query.addCondition(ColumnCondition.eq(id));Optional<ColumnEntity> result = columnEntityManager.singleResult(query);

//cassandra implementationList<ColumnEntity> entities = columnEntityManagerCassandra.cql("select * from newKeySpace.newColumnFamily where id=10;");columnEntityManagerCassandra.save(entity, ConsistencyLevel.ALL);

Page 25: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

NoSQL Providers

Page 26: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

JUGs/Communities

Page 27: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Graph API

● Apache TinkerPop● Apache Project● 12 Graph databases● Most stable code● Adapter layer

Page 28: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Artemis● CDI Based● Diana Based● Annotation Based● Events to insert, delete, update● Supports to Bean Validation● Configurable and extensible

Page 29: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Annotations

● MappedSuperclass● Entity● Column

@Entity("movie")public class Movie {

@Column private String name;

@Column private long year;

@Column private Set<String> actors;

Page 30: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Events

Movie

firePreEntity firePreAPI firePostAPI firePostEntity

Interceptor

Page 31: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Configurable and extensible

● EventManager● CrudOperation● ClassRepresentations● Converter● Decorate● Replace

Page 32: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Why Diana?

● Goddess of the hunt, nature and moon

● Fought in Troy● brave warrior and hunter

Page 33: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Road Map

● Draft and code Proposal● Community Feedback● Involve NoSQL Vendors● Involve Solution Vendors● Eclipse Project● Development● JSR

Page 34: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Site

http://jnosql.org/

Page 35: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Code

https://github.com/JNOSQL

Page 36: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Mailing List

https://dev.eclipse.org/mailman/listinfo/jnosql-dev

Page 37: Let's talk about NoSQL Standard ·  · 2017-01-23Clouddata SimpleDb ... Consistency Level SQL based Diversity in NoSQL. The Challenge

Mailing List

https://gitter.im/JNOSQL/developers