20
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle NoSQL O que o Oracle NoSQL tem para oferecer? Bruno Borges Principal Product Manager Oracle Latin America Agosto, 2014 Oracle Confidential Internal/Restricted/Highly Restricted

Introdução ao Oracle NoSQL

Embed Size (px)

DESCRIPTION

Pouca gente sabe, mas existe um banco de dados NoSQL da Oracle! E já está na versão 3.0! O banco de dados Oracle NoSQL armazena os dados num modelo chave-valor distribuído. Ele é projetado para fornecer armazenamento de dados altamente confiável, escalável e disponível através de um conjunto configurável de sistemas que funcionam como nós de armazenamento. Por trás de toda esta engenharia há uma tecnologia talvez mais conhecida: o Berkeley DB. Conheça mais sobre o Oracle NoSQL Community Edition, e também a versão Enterprise Edition.

Citation preview

Page 1: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Oracle NoSQL O que o Oracle NoSQL tem para oferecer?

Bruno Borges Principal Product Manager Oracle Latin America Agosto, 2014

Oracle Confidential – Internal/Restricted/Highly Restricted

Page 2: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

• Bruno Borges

– Principal Product Manager, Java Evangelist – Oracle Latin America

– @brunoborges – [email protected]

Speaker

Page 3: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Embedded

+Light weight

Web Scale-out &

Real-time events

+Schema-less

+Relaxed consistency

+Built-in availability

Web & Departmental

+SQL and NoSQL

+Basic security

Mission Critical OLTP and

Data Warehousing

+SQL, Transactions

+High Availability and Security

+Multitenant architecture

Oracle Enterprise Manager Oracle Enterprise Manager

Providing the right database technology for the job

Oracle Databases

Page 4: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Oracle NoSQL Database

• Key Features

– Flexible Key-Value Data Model

– ACID transactions

– Horizontally Scalable

– Highly Available

– Elastic Configuration

– Simple administration

– Intelligent Driver

– Commercial grade software and support

Scalable, Highly Available, Key-Value Database Application

Storage Nodes Datacenter B

Storage Nodes Datacenter A

Application

NoSQL DB Driver

Application

NoSQL DB Driver

Application

Page 5: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Key-Value Database, Escalável, Distribuido

Oracle NoSQL Database

• Topologia Inteligente

– Reliability process placement

– Integrated load balancing

– Data center awareness

– Multi-master, wide partitioning

• Elastic Expansion

– Auto rebalance & compaction

• Base and ACID – Rollback on failures

Application

Smart Topology Driver

Page 6: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Oracle NoSQL Database by the Numbers

• Predictable performance over time

– No planned outages required

• Smart resource management – Scale JUST when needed

• Upgrade releases with no outage

Performance, Scale and Manageability Testing

Page 7: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Performance Previsível

• Qual a importância?

– 360 clientes utilizados

– Geração de dados contínua

– Cluster expandido em 50%

– Baixa latência

– Alto throughput

– Sistema sempre online

– Pronto para mais clientes

Expansão de Cluster Online

0

1

2

3

4

5

6

7

8

0

10.000

20.000

30.000

40.000

50.000

60.000

70.000

144 (48x3)

20% 40% 60% 80% 216 (72x3)

Ave

rage

Lat

en

cy (

ms)

Thro

ugh

pu

t (o

ps/

sec)

95/5 Read/Update Throughput

Throughput (ops/sec) Read Latency (ms) Update Latency (ms)

Page 8: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Gestão Inteligente de Recursos

• Qual a importância?

– Prepare-se para o Natal

• Aumento em número de clientes para 540

• Escala linear de throughput

• Latência permanece a mesma: 6ms

• Sistema sempre online

Oracle Confidential – Internal/Restricted/Highly Restricted 9

Escale somente quando necessário

0

10.000

20.000

30.000

40.000

50.000

60.000

70.000

80.000

90.000

144 (48x3) 216* (72x3)

Thro

ugh

pu

t (o

ps/

sec)

12->18 Machines, 144->216 Nodes

95/5 Read/Update Throughput

Page 9: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Exemplos e Demos

Oracle Confidential – Internal/Restricted/Highly Restricted 10

Page 10: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Conecanto ao Oracle NoSQL

String storeName = "kvstore";

String hostName = "localhost:5000";

KVStoreConfig kvConfig = new KVStoreConfig(storeName, hostName);

try (KVStore store = KVStoreFactory.getStore(kvConfig)) {

// ... Manipula a store

}

Oracle Confidential – Internal/Restricted/Highly Restricted 11

Page 11: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Exemplo de CRUD

// Coloca nova chave/valor se ainda não existe

Key key = Key.createKey("Katana");

String valString = "sword";

store.putIfAbsent(key, Value.createValue(valString.getBytes()));

// Deleta esta chave (e valor) do banco de dados

store.delete(key);

Oracle Confidential – Internal/Restricted/Highly Restricted 12

Page 12: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Exemplo de CRUD

// Leitura de dados do banco

ValueVersion retValue = store.get(key);

// Atualiza este item somente se a versão for a mesma que a lida

String newvalString = "Really nice sword";

Value newval = Value.createValue(newvalString.getBytes());

store.putIfVersion(key, newval, retValue.getVersion());

Oracle Confidential – Internal/Restricted/Highly Restricted 13

Page 13: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Apache Avron – Definição de Schemas

• Framework para serialização de dados

• Features

– Estruturas de dados ricas

– Compacta, rápida, formato de dados binário

– Container file para persistir dados

– Suporte a RPC

– Integrado ao Oracle NoSQL

Oracle Confidential – Internal/Restricted/Highly Restricted 14

JSON format

Page 14: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Schema Definition em JSON

{

"type": "record",

"namespace": "schema.namespace",

"name": "schema.name",

"fields": [

{ "name": "field1", "type": "string" },

{ "name": "field2", "type": "int" }

]

}

Oracle Confidential – Internal/Restricted/Highly Restricted 15

Com Apache Avron

$> java -jar lib/kvstore.jar runadmin -host localhost -port 5000 kv-> ddl add-schema -file sample-schema.avsc

Page 15: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Incluindo JSON dentro do Oracle NoSQL

ObjectNode name = JsonNodeFactory.instance.objectNode(); name.put("first", "Percival"); name.put("last", "Lowell"); JsonRecord record = new JsonRecord(member, memberInfoSchema); store.put(key, binding.toValue(record));

Oracle Confidential – Internal/Restricted/Highly Restricted 16

Page 16: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Bonus: Acesso via REST

• fka Oracle APEX Listener

• Futura versão 3.0 do Oracle REST Data Services – Roadmap

– Oracle NoSQL

– Oracle Database

– JSON format

– Automatic linkage master-detail

– PL/SQL API to generate REST services

– Test environment on Oracle SQL Developer

Oracle Confidential – Internal/Restricted/Highly Restricted 17

Page 17: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Oracle NoSQL Database Fully integrated for the Enterprise

Real Time Access External Tables

MapReduce, OLH, ODC, ODI

NoSQL DB Driver

Application

GRAPH

Page 18: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

oracle.com/goto/nosql Para saber mais, visite o site.

Page 19: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Safe Harbor Statement

The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Oracle Confidential – Internal/Restricted/Highly Restricted 20

Page 20: Introdução ao Oracle NoSQL

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 21