SlideShare ist ein Scribd-Unternehmen logo
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Die Oracle NoSQL Datenbank
Karin Patenge | Leitende Systemberaterin | karin.patenge@oracle.com
Oracle Deutschland B.V. & Co KG
Twitter: @ModernAppDev12c | Web: http://tinyurl.com/ModernAppDev12c
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Agenda
1
2
3
4
Begriffe und Thematische Einordnung
Kurzer Überblick zur Oracle NoSQL Datenbank
Oracle NoSQL DB in der Praxis – Installation und Betrieb
Oracle NoSQL DB in der Praxis – Anwendungsentwicklung
Weiterführende Links und Informationen
3
5
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
1
2
3
4
Begriffe und Thematische Einordnung
Kurzer Überblick zur Oracle NoSQL Datenbank
Oracle NoSQL DB in der Praxis – Installation und Betrieb
Oracle NoSQL DB in der Praxis – Anwendungsentwicklung
Weiterführende Links und Informationen
4
5
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
NoSQL: Versuch einer Definition
„A NoSQL (originally referring to
“non SQL” database provides a
mechanism for storage and
retrieval of data that is modeled in
means other than the tabular
relations used in relational
databases.”
[Quelle: Wikipedia]
• NoSQL  „Not only SQL“
• Sammelbegriff für nicht-relationale Datenbanken, die
– Massiv parallelisierbar sind,
– horizontal verteilt auf mehreren Servern Daten ablegen
(„Sharding“),
– weitgehend ohne Datenmodell („Schema-less“) arbeiten
– Datenkonsistenz nicht zwingend durchsetzen (nicht ACID
compliant),
– keine Join-Operationen oder Multi-Object Transaktionen
unterstützen,
– und sehr entwicklerspezifisch sind.
• Derzeit noch keine Standardisierung
– Keine Abfragesprache (eben "NoSQL")
– Massive Produktvielfalt
(Siehe http://www.nosql-database.org/ )
– Produkte nur schwer vergleichbar
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
NoSQL Datenbanken – Eine Kategorisierung
Key-Value
Stores
Bsp.:
Oracle NoSQL DB
Redis
Document
Stores
Bsp.:
MongoDB
MarkLogic
Column Stores / BigTable
Bsp.:
HBase
Cassandra
Graph
Datenbanken
Bsp.:
Neo4J
Oracle NoSQL + Graph
7
Abbildungen: http://www.thoughtworks.com/insights/blog/nosql-databases-overview
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
1
2
3
4
Begriffe und Thematische Einordnung
Kurzer Überblick zur Oracle NoSQL Datenbank
Oracle NoSQL DB in der Praxis – Installation und Betrieb
Oracle NoSQL DB in der Praxis – Anwendungsentwicklung
Weiterführende Links und Informationen
9
5
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Oracle NoSQL Database
• Basiert auf Oracle Berkeley DB Java Edition High Availability
• Datenhaltung – ready for web scale
– Hochverfügbarkeit per Replikation
– Transparentes Loadbalancing
– Konsistenz und Persistenz konfigurierbar (ACID <-> BASE)
• Key-Value Datenhaltung als Basis
– JSON, AVRO Support
– Table API, Sekundärindexe
• Einfache Installation, Einrichtung und Erweiterung
• Läuft auf mehreren Knoten
– Ausnahme: „Lite“ Version läuft auf nur einem Knoten
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Die Basis: Was ist ein "Key-Value-Store"?
• Ansammlung von Key-Value-Paaren in einem Store, verteilt auf Partitionen
– Key – String, Major & Minor Key
– Value – Byte Array
• Identifikation über Key (oder Teile davon), Auslesen des Value
• Einfache Zugriffe: GET, PUT, DELETE
• Keine Standard-Abfragesprache wie SQL für RDBMS
Key Value
010101010 0198287981A98721891209A0909109039810983A0919032093091A
010101011 Das ist ein Text, der als Value abgelegt ist
… 000101010010111111010010101000111
Datenstrukturen sind nicht selbstbeschreibend
Zeilen
Key-Value Store CUSTOMERSKey = Index
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Oracle NoSQL Database Topologie
Partition 1 Partition 2 Partition 3
Storage
Nodes
Load balancer
Webserver Webserver
Application Server
NoSQLDB Treiber
Application Server
NoSQLDB Treiber
R M R
Application
Server
Webserver
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
1
2
3
4
Begriffe und Thematische Einordnung
Kurzer Überblick zur Oracle NoSQL Datenbank
Oracle NoSQL DB in der Praxis – Installation und Betrieb
Oracle NoSQL DB in der Praxis – Anwendungsentwicklung
Weiterführende Links und Informationen
16
5
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Die Oracle NoSQL DB in der Praxis
Installation und Betrieb
1. Kurze Diskussion der Deployment Optionen
2. Voraussetzungen prüfen
3. Kapazitätsplanung
4. Installation durchführen
5. Zielarchitektur definieren
6. NoSQL DB Cluster aufsetzen
7. Cluster erweitern
8. Ein neues Data Center hinzufügen
18
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Demo-Setup
• „Spielwiese“ Oracle Big Data Lite
VM v4.4.0
– Download:
http://www.oracle.com/technetwork/databas
e/bigdata-appliance/oracle-bigdatalite-
2104726.html
– Benötigt VirtualBox
(freie Desktop-Virtualisierung)
– Vorinstallierte Software-Komponenten
– Beispieldaten und –Skripte
– Hands-On Labs
Oracle Confidential – Internal/Restricted/Highly Restricted 19
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 1: Deployment Optionen
„Do-it-yourself“ NoSQL DB Cluster
• Was muss beachtet werden
– Hardware
– Netzwerk
– Sizing
– Installation
– Konfiguration
– Deployment
– Patchen
– Load Balancing
– ...
Engineered Systems Ansatz
• Oracle Big Data Appliance
– Schnell einsetzbar, günstige TCO, skalierbar
– Pre-integrated full rack configuration
• Oracle's Sun x86 Servers
• InfiniBand und Ethernet Connectivity
– Vorinstallierte SW-Komponenten
• U.a. NoSQL DB, Oracle R, Cloudera Enterprise
Technology software including Cloudera CDH, Cloudera
Manager, and Cloudera RTQ (Impala)
– Perfekt ausbalanciert
– Erweiterbar
20
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 2: Voraussetzungen prüfen
$ java –version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build
1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build
25.60-b23, mixed mode)
$ jps
3859 Jps
$
21
• Java SE Version 7 oder höher wird
vorausgesetzt
– Bezogen auf NoSQL Database 12cR1
• JPS (Java Virtual Machine Process
Status Tool)
– Standard-Werkzeug von Java SE
• Empfehlung:
NoSQL DB Knoten nicht auf
virtuellen Maschinen installieren
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 3a: Bestimmen der NoSQL DB Cache Größe
• DBCacheSize Werkzeug je.jar in
$KVHOME/lib
• Input:
– 1 Milliarde Sätze (K-V-Paare)
– Durchschn. Schlüsselgröße 15 Bytes
– Durchschn. Satzlänge 1 KB
• Ergebnis im Beispiel:
– 43 GB werden für das Cachen der
Schlüssel im Hauptspeicher benötigt
– Wieviel Hauptspeicher hat ein Storage
Node? Wieviel davon wird für den Cache
allokiert? Daumenregel -> ca. 60%
22
$ java -d64 -XX:+UseCompressedOops -jar
$KVHOME/lib/je.jar DbCacheSize -records
1000000000 -key 15 -data 1024
=== Environment Cache Overhead ===
3,157,213 minimum bytes
To account for JE daemon operation, record
locks, HA network connections, etc,
a larger amount is needed in practice.
=== Database Cache Size ===
Number of Bytes Description
--------------- -----------
43,126,658,112 Internal nodes only
1,113,239,107,552 Internal nodes and leaf
nodes
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 3b: Kapazitätsplanung für NoSQL DB
• Ermitteln von
– Anzahl der Storage Nodes
– Replikationsfaktor
– Anzahl der Partitionen
• InitialCapacityPlanning Werkzeug
– InitialCapacityPlanning.xls
in $KVHOME/doc/misc
23
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 4: Installation und Start auf einem Storage Node
$ mkdir <path1>/kv
$ cd <path1>/ kv
$ cp <path2>/kv-ee-3.5.2.tar.gz .
$ gunzip kv-ee-3.5.2.tar.gz
$ tar xvf kv-ee-3.5.2.tar
kv-3.5.2/
kv-3.5.2/doc/
...
$ cd kv-3.5.2
$ KVHOME=<path1>/kv/kv-3.5.2
$ export KVHOME
$ mkdir –p $KVHOME/kvroot
$ KVROOT=$KVHOME/kvroot
$ export KVROOT
$ java –jar $KVHOME/lib/kvstore.jar kvlite &
Created new kvlite store with args:
-root ./kvroot -store kvstore -host <host> -port 5000 -admin
5001
$ jps
6412 Jps
6302 kvstore.jar
$ java -jar lib/kvstore.jar ping -host <host> -port 5000
Pinging components of store kvstore based upon topology
sequence #14
10 partitions and 1 storage nodes
24
• Download-Seite
– http://www.oracle.com/technetwork/database/databa
se-technologies/nosqldb/downloads/index.html
• 2 Editionen verfügbar
– Community und Enterprise Edition
• Zusätzliche Software-Komponenten
– RDF Jena Adapter für NoSQL DB EE
– Treiber: Java, C, JavaScript, Python
• Installation auf jedem Storage Node
notwendig
– Verzeichnisname sollte überall identisch sein
• Umgebungsvariablen KVHOME und
KVROOT setzen
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 5: Topologie für die NoSQL Datenbank definieren
Lineare Skalierung und Replikation
25
• Elastic Auto Sharding
(split, add, contract)
Store
Shard
M
Shard
R
R
R R
Application
NoSQL Driver
M
• Writes to elected
node with flexible
durability
• Reads from any
node in system
Shard
R
R
M
Expand and Rebalance
Shard
M
R
R
• Auto re-balance of
data on expansion
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 6: 3x3 NoSQL Datenbank Cluster (1 Data Center)
$ cd /u01/nosql/scripts
$ ./makebootconfig.sh
Killing Java processes ...
kill 3446: No such process
Deleting old directories...
Creating new directories...
Done bootstrapping storage-node 1
Done bootstrapping storage-node 2
Done bootstrapping storage-node 3
$ ./startSNA.sh
$ jps –m
3761 ManagedService
3590 kvstore.jar
3591 kvstore.jar
...
$ ./runScript.sh 3x3.kvs
Connected to Admin in read-only mode
Connected to Admin in read-only mode
Store configured: kvstore
Executed plan 1, waiting for completion...
Plan 1 ended successfully
Executed plan 2, waiting for completion...
...
26
1. Bootstrapping auf den 3 beteiligten
Storage Nodes
2. Starten der Agenten auf den Storage
Nodes
3. Deployment einer 3x3 Topologie auf
den Storage Nodes
4. Überprüfen der Topologie
http://localhost:5001/
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 27
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 7: Hinzufügen eines neuen Shards (3x3 -> 4x3)
$ ./makebootconfig-sn4.sh
Done bootstrapping storage-node 4
$ ./startSNA-sn4.sh
$ ./runScript.sh 4x3.kvs
Executed plan 9, waiting for completion...
Plan 9 ended successfully
Created 4x3
Redistributed: 4x3
Topology transformation from current deployed
topology to 4x3:
Create 1 shard
Create 3 RNs
Relocate 2 RNs
Migrate 30 partitions
...
Executed plan 10, waiting for completion...
Plan 10 ended successfully
$
28
1. Bootstrapping auf neuem Storage Node
2. Starten des Agenten auf neuem Storage
Nodes
3. Deployment einer 4x3 Topologie
– Hinzufügen eines Storage Node zum Data
Center
– Klonen der Topologie
– Redistribution: Neues Shard,
Replikationsknoten, Verschieben der
Partitionen, Rebalancing des Clusters
4. Überprüfen der Topologie
http://localhost:5001/
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 29
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 8: Hinzufügen eines neuen Data Center (4x3 -> 4x4)
$ ./makebootconfig-sn5.sh
Done bootstrapping storage-node 5
$ ./startSNA-sn5.sh
$ ./runScript.sh 4x4.kvs
Executed plan 11, waiting for completion...
Plan 11 ended successfully
Executed plan 12, waiting for completion...
Plan 12 ended successfully
Created 4x4
Redistributed: 4x4
Topology transformation from current deployed topology
to 4x4:
Create 4 RNs
...
Executed plan 13, waiting for completion...
Plan 13 ended successfully
$ java -jar /u01/nosql/kv-ee/lib/kvstore.jar runadmin -
port 5000 -host kvhost01
kv-> show topology
store=kvstore numPartitions=120 sequence=179
zn: id=zn1 name=Potsdam repFactor=3 type=PRIMARY
zn: id=zn2 name=Berlin repFactor=1 type=PRIMARY
30
1. Bootstrapping auf neuem Storage Node
2. Starten des Agenten auf neuem Storage
Nodes
3. Deployment einer 4x4 Topologie
– Anlegen eines neuen Data Center
– Hinzufügen eines Storage Node zum neuen
Data Center
– Klonen der Topologie
– Redistribution: Neues Shard,
Replikationsknoten, Verschieben der
Partitionen, Rebalancing des Clusters
4. Überprüfen der Topologie
http://localhost:5001/ oder über
Kommandozeilenwerkzeug
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 31
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
1
2
3
4
Begriffe und Thematische Einordnung
Kurzer Überblick zur Oracle NoSQL Datenbank
Oracle NoSQL DB in der Praxis – Installation und Betrieb
Oracle NoSQL DB in der Praxis – Anwendungsentwicklung
Weiterführende Links und Informationen
32
5
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Die Oracle NoSQL DB in der Praxis
Anwendungsentwicklung
1. Erste Schritte mit der NoSQL DB: HelloModernAppDev.java
2. NoSQL DB Table API
3. Mittels REST API auf die Oracle NoSQL DB
4. Oracle NoSQL DB als Graph Datenbank: Knoten und Kanten
5. NoSQL DB mit Oracle DB über externe Tabellen verbinden
34
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 1: Ein HelloWorld-Beispiel mit der Java API
$ cd $KVHOME
$ java -jar $KVHOME/lib/kvstore.jar kvlite
$ Opened existing kvlite store with config:
-root ./kvroot -store kvstore -host <hostname> -
port 5000 -admin 5001
$ # 2. Terminalfenster
$ java -jar $KVHOME/lib/kvstore.jar ping -port
5000 -admin 5001 -host <hostname>
$ cd $KVHOME
$ gedit examples/hello/HelloModernAppDev.java
$ javac -cp examples:lib/kvclient.jar
examples/hello/HelloModernAppDev.java
$ java -cp examples:lib/kvclient.jar
hello.HelloModernAppDev
Hello Modern App Dev 12c Community !
$
35
• KVLITE
– Auf Basis einer 1x1 Topologie
• 1 Storage Node, 10 Partitionen
• KVLITE starten
• HelloModernAppDev.java
– Kompilieren und ausführen
– Key-Value Paare
• CRUD Operationen: PUT, GET, DELETE
• JavaDoc
http://docs.oracle.com/cd/NOSQL/html/javado
c/overview-summary.html
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 2: Table API
$ cd $KVHOME
$ java -jar lib/kvstore.jar runadmin -port 5000 -host
<hostname>
kv-> table create -name EMP
EMP-> add-field -type INTEGER -name empno
EMP-> add-field -type STRING -name ename
EMP-> add-field -type DOUBLE -name sal
EMP-> add-field -type STRING -name job
EMP-> primary-key -field empno
EMP-> exit
Table EMP built.
kv-> plan add-table -name EMP -wait
Executed plan 11, waiting for completion...
Plan 11 ended successfully
kv-> connect store -host localhost -port 5000 -name
kvstore
Connected to kvstore at localhost:5000.
kv-> put table -name EMP -json '{"empno":815,
"ename":"JONES", "sal": 3500, "job":"MANAGER"}'
Operation successful, row inserted.
...
kv-> get table –name emp
kv-> get –kv all
...
36
• Nutzen des CLI
• Operationen
– PUT TABLE, GET TABLE
• JavaDoc
http://docs.oracle.com/cd/E57769_01/ht
ml/javadoc/oracle/kv/table/TableAPI.htm
l
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 2: Table API – Tabellen im SQL Developer
37
• Verbindung auf NoSQL DB anlegen
– Host: <hostname>
– Store: kvstore
• Navigation wie gewohnt
• Nur Lese-Zugriffe
– Tabellen
– Daten
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Oracle12c. Tabellen.
Oracle12c. JSON
Document Store.
Oracle NoSQL DB
Oracle REST Data Services
(ORDS)
Schritt 3: REST API für NoSQL DB
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 3: Mit REST API auf NoSQL DB zugreifen
$ cd /u01/ords
$ java -jar ords.war standalone
$ java -jar ords.war nosqladd --pagelimit 20 sales
kvstore localhost:5000
$ // Browser
http://localhost:7070/ords/sales/metadata-catalog
http://localhost:7070/ords/sales/metadata-
catalog/tables/emp/
http://localhost:7070/ords/sales/metadata-
catalog/tables/emp/item
http://localhost:7070/ords/sales/tables/emp
http://localhost:7070/ords/sales/tables/emp/7999
curl -i -H "Content-Type: application/json" -X PUT -d
"{"empno": 8000, "ename": "PATENGE", "job":
"Consultant"}"
"http://localhost:7070/ords/sales/tables/emp/"
http://localhost:7070/ords/sales/tables/emp/8000
39
• ORDS installieren und konfigurieren
• Hier: Starten als Standalone
• NoSQL DB Store registrieren
• Auf Metadaten-Katalog zugreifen
• Auf Metadaten einer spezifischen
Tabelle zugreifen
• Auf Tabellendaten zugreifen
– Über Schlüssel
• CRUD
• Hinweis: JSON-Anzeige im Browser
– Hier: Plug-in für Firefox
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Schritt 4: Oracle NoSQL DB als Graph Datenbank
$ cd /opt/oracle/oracle-spatial-
graph/property_graph/dal/groovy
$ ./gremlin-opg-nosql.sh
opg-nosql> // Connect to the Oracle NoSQL DB
opg-nosql> server = new ArrayList<String>();
opg-nosql> server.add("bigdatalite:5000");
==>true
opg-nosql> cfg=new PgNosqlGraphConfigBuilder()
opg-nosql> .setDbEngine(DbEngine.NOSQL) 
opg-nosql> .setName("helloWorldGraph") 
opg-nosql> .setStoreName("kvstore") 
opg-nosql> .setHosts(server) 
opg-nosql> .addEdgeProperty("label",
PropertyType.STRING, "label") 
opg-nosql> .setMaxNumConnections(1).build();
...
• Knoten-Kanten-Modell
– Knoten und Kanten mit Attributen
• In-Memory Parallel Graph Analysis
– PGX Framework
– Beispiel mit Groovy Shell
• Teil von Oracle Big Data Spatial and
Graph
vertex1 vertex2
edge1
name: ″ Karin ″
location: ″Potsdam″
gender:“female“
name: ″Carsten″
location: ″Munich″
isColleagueOf
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
1
2
3
4
Begriffe und Thematische Einordnung
Kurzer Überblick zur Oracle NoSQL Datenbank
Oracle NoSQL DB in der Praxis – Installation und Betrieb
Oracle NoSQL DB in der Praxis – Anwendungsentwicklung
Weiterführende Links und Informationen
45
5
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
NoSQL DB Enterprise Edition und Community Edition
Feature NoSQL DB CE NoSQL DB EE
Lizenzkosten Verfügbar unter der AGPL License R
MyOracleSupport R R
Diskussionsforen R R
Open Source R
Java und C API R R
ACID Transaktionen R R
Large Object Support R R
Kein Single Point Of Failure R R
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
NoSQL DB Enterprise Edition und Community Edition
Feature NoSQL DB CE NoSQL DB EE
Integation mit Hadoop R R
Table API R R
RDBMS Integration Ext. Tables R
Jena Adapter (Graph/SPARQL) R
Event Processing (CQL) R
Online Administration R R
JMX Monitoring R R
SNMP Monitoring R
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Hilfreiche Informationen und Links
• Öffentlich verfügbare Inhalte
– Oracle Oracle NoSQL im OTN http://www.oracle.com/technetwork/database/database-
technologies/nosqldb/documentation/index.html
– Online Dokumentation http://docs.oracle.com/cd/NOSQL/html/index.html
– JavaDoc der Java API http://docs.oracle.com/cd/NOSQL/html/javadoc/index.html
– Wieviel Storage Nodes werden benötigt – Ressourcen planen für die Oracle NoSQL DB:
http://docs.oracle.com/cd/NOSQL/html/AdminGuide/Oracle-NoSQLDB-Admin.pdf#page=16
– Oracle Big Data Lite VM http://www.oracle.com/technetwork/community/developer-vm/index.html#bdl
– Oracle Dojo # 2 zu „Big Data: Eine Einführung in Oracle NoSQL DB, Hadoop MapReduce, Oracle Big Data
Connectors“ http://www.oracle.com/webfolder/technetwork/de/community/dojo/index.html
– Blog von Charles Lambs https://blogs.oracle.com/charlesLamb/
– Vortrag metafinanz Informationssysteme GmbH auf DOAG Konferenz 2013
http://www.metafinanz.de/sites/default/files/DOAG_2013_Oracle NoSQL Database.pdf
50
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 51
20160310_ModernApplicationDevelopment_NoSQL_KPatenge

Weitere ähnliche Inhalte

PDF
Überblick zu Oracle Database 12c Release 2
PDF
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
PDF
Oracle Database Appliance X5-2
PDF
Überblick Oracle Datenbank Hochverfügbarkeit
PDF
Oracle Engineered Systems - Chance oder Risiko?
PDF
Oracle Database Appliance X4-2
PDF
Oracle12c für Entwickler
PDF
Überblick Oracle GoldenGate
Überblick zu Oracle Database 12c Release 2
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
Oracle Database Appliance X5-2
Überblick Oracle Datenbank Hochverfügbarkeit
Oracle Engineered Systems - Chance oder Risiko?
Oracle Database Appliance X4-2
Oracle12c für Entwickler
Überblick Oracle GoldenGate

Was ist angesagt? (20)

PDF
Oracle Technology Monthly Oktober 2017
PDF
20171121_DOAGKonferenz_JSON_OracleNoSQL_KPatenge
PDF
Oracle GoldenGate Monitoring
PDF
Oracle Database In-Memory Advisor (Deutsch)
PDF
Big Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im Überblick
PDF
Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012
PDF
Das ende von owb was nun migrationspfade fuer owb_projekte-dani schnider-stan...
PDF
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
PDF
Überblick Oracle Datenbank 12c
PDF
Replikation im heterogenen Umfeld mit Oracle GoldenGate
PDF
Oracle und Docker
PDF
Infinispan - NoSQL für den Enterprise Java Alltag
PDF
20181210_ITTage2018_OracleNoSQLDB_KPatenge
PDF
DOAG Webinar Oracle und Docker
PDF
Rsyslog - Deutsche Qualitätsarbeit für Linux
PDF
Oracle Database Appliance, Partnerwebcast, November 2011
PDF
Codd & ACID - ein Ausflug in die Datenbank-Theorie und Geschichte
PDF
Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?
PDF
Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...
PDF
Oracle Database 12c In-Memory Option
Oracle Technology Monthly Oktober 2017
20171121_DOAGKonferenz_JSON_OracleNoSQL_KPatenge
Oracle GoldenGate Monitoring
Oracle Database In-Memory Advisor (Deutsch)
Big Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im Überblick
Oracle Database Appliance, DOAG Regio Berlin Brandenburg, Juni 2012
Das ende von owb was nun migrationspfade fuer owb_projekte-dani schnider-stan...
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
Überblick Oracle Datenbank 12c
Replikation im heterogenen Umfeld mit Oracle GoldenGate
Oracle und Docker
Infinispan - NoSQL für den Enterprise Java Alltag
20181210_ITTage2018_OracleNoSQLDB_KPatenge
DOAG Webinar Oracle und Docker
Rsyslog - Deutsche Qualitätsarbeit für Linux
Oracle Database Appliance, Partnerwebcast, November 2011
Codd & ACID - ein Ausflug in die Datenbank-Theorie und Geschichte
Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?
Oracle GoldenGate: Synchronisation zwischen Oracle und MySQL Datenbanken, Nov...
Oracle Database 12c In-Memory Option
Anzeige

Ähnlich wie 20160310_ModernApplicationDevelopment_NoSQL_KPatenge (20)

PDF
Oracle Database 12c Release 2
PDF
Agile Oracle database modeling and development - APEX Connect 2020
PPTX
Spezialitäten der Oracle Lizenzierung - DOAG Konferenz 2010 - OPITZ CONSULTI...
PDF
20181120_DOAG_OracleNoSQLDB_KPatenge
PDF
Docker-Images mit vorinstallierter Instanz einer Oracle-DB
PPTX
Datenbanken - Eine Übersicht (WPMeetUP München)
PPTX
Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13
PDF
IPv6 Integration im Datacenter - wie komplex ist es wirklich?
PDF
Boost your APEX Deployment and Provisioning with Docker
PDF
Oracle AVDF in der Praxis
PPTX
Sesam (APEX) Öffne Dich
PDF
DB2 High Availability für IBM Connections, Sametime oder Traveler
PPTX
What’s new in Apache Solr 4.7 und Elasticsearch 1.1
PDF
Oracle hadoop doag-big-data_09_2014_gpi
PDF
Was Sie über NoSQL Datenbanken wissen sollten!
PDF
OC|Webcast: Oracle Lizenzierung - Lizenznews 2021
PPTX
Best Practices SharePoint and SQL Installation
PDF
Cloud-native and Enterprise Java? Hold my beer!
PDF
Oracle Private & Public Database-as-a-Service
PDF
Big Data Konnektivität
Oracle Database 12c Release 2
Agile Oracle database modeling and development - APEX Connect 2020
Spezialitäten der Oracle Lizenzierung - DOAG Konferenz 2010 - OPITZ CONSULTI...
20181120_DOAG_OracleNoSQLDB_KPatenge
Docker-Images mit vorinstallierter Instanz einer Oracle-DB
Datenbanken - Eine Übersicht (WPMeetUP München)
Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13
IPv6 Integration im Datacenter - wie komplex ist es wirklich?
Boost your APEX Deployment and Provisioning with Docker
Oracle AVDF in der Praxis
Sesam (APEX) Öffne Dich
DB2 High Availability für IBM Connections, Sametime oder Traveler
What’s new in Apache Solr 4.7 und Elasticsearch 1.1
Oracle hadoop doag-big-data_09_2014_gpi
Was Sie über NoSQL Datenbanken wissen sollten!
OC|Webcast: Oracle Lizenzierung - Lizenznews 2021
Best Practices SharePoint and SQL Installation
Cloud-native and Enterprise Java? Hold my beer!
Oracle Private & Public Database-as-a-Service
Big Data Konnektivität
Anzeige

Mehr von Karin Patenge (15)

PDF
20190704_AGIT_Georaster_ImageryData_KPatenge
PDF
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
PDF
20181123 dn2018 graph_analytics_k_patenge
PDF
20180921_DOAG_BigDataDays_OracleSpatialandPython_kpatenge
PDF
20181019 code.talks graph_analytics_k_patenge
PDF
OracleCode_Berlin_Jun2018_AnalyzeBitcoinTransactionDataUsingAsGraph
PPTX
Graph Analytics on Data from Meetup.com
PDF
5 Gründe für Oracle Spatial Technologies
PDF
IT-Tage 2017: Visuelle Analyse komplexer Datenbestände am Beispiel der Panama...
PDF
20171106_OracleWebcast_ITTrends_EFavuzzi_KPatenge
PDF
Oracle NoSQL Database: Integration in den Oracle Enterprise Manager 12
PDF
20160229_ModernApplicationDevelopment_Python_KPatenge
PDF
Datenbank-gestützte Validierung und Geokodierung von Adressdatenbeständen
PPTX
Raster Algebra mit Oracle Spatial und uDig
PPTX
Geodatenmanagement und -Visualisierung mit Oracle Spatial Technologies
20190704_AGIT_Georaster_ImageryData_KPatenge
20190703_AGIT_GeoRasterWorkshop_GriddedData_KPatenge
20181123 dn2018 graph_analytics_k_patenge
20180921_DOAG_BigDataDays_OracleSpatialandPython_kpatenge
20181019 code.talks graph_analytics_k_patenge
OracleCode_Berlin_Jun2018_AnalyzeBitcoinTransactionDataUsingAsGraph
Graph Analytics on Data from Meetup.com
5 Gründe für Oracle Spatial Technologies
IT-Tage 2017: Visuelle Analyse komplexer Datenbestände am Beispiel der Panama...
20171106_OracleWebcast_ITTrends_EFavuzzi_KPatenge
Oracle NoSQL Database: Integration in den Oracle Enterprise Manager 12
20160229_ModernApplicationDevelopment_Python_KPatenge
Datenbank-gestützte Validierung und Geokodierung von Adressdatenbeständen
Raster Algebra mit Oracle Spatial und uDig
Geodatenmanagement und -Visualisierung mit Oracle Spatial Technologies

20160310_ModernApplicationDevelopment_NoSQL_KPatenge

  • 2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Die Oracle NoSQL Datenbank Karin Patenge | Leitende Systemberaterin | karin.patenge@oracle.com Oracle Deutschland B.V. & Co KG Twitter: @ModernAppDev12c | Web: http://tinyurl.com/ModernAppDev12c
  • 3. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Agenda 1 2 3 4 Begriffe und Thematische Einordnung Kurzer Überblick zur Oracle NoSQL Datenbank Oracle NoSQL DB in der Praxis – Installation und Betrieb Oracle NoSQL DB in der Praxis – Anwendungsentwicklung Weiterführende Links und Informationen 3 5
  • 4. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 Begriffe und Thematische Einordnung Kurzer Überblick zur Oracle NoSQL Datenbank Oracle NoSQL DB in der Praxis – Installation und Betrieb Oracle NoSQL DB in der Praxis – Anwendungsentwicklung Weiterführende Links und Informationen 4 5
  • 5. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | NoSQL: Versuch einer Definition „A NoSQL (originally referring to “non SQL” database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases.” [Quelle: Wikipedia] • NoSQL  „Not only SQL“ • Sammelbegriff für nicht-relationale Datenbanken, die – Massiv parallelisierbar sind, – horizontal verteilt auf mehreren Servern Daten ablegen („Sharding“), – weitgehend ohne Datenmodell („Schema-less“) arbeiten – Datenkonsistenz nicht zwingend durchsetzen (nicht ACID compliant), – keine Join-Operationen oder Multi-Object Transaktionen unterstützen, – und sehr entwicklerspezifisch sind. • Derzeit noch keine Standardisierung – Keine Abfragesprache (eben "NoSQL") – Massive Produktvielfalt (Siehe http://www.nosql-database.org/ ) – Produkte nur schwer vergleichbar
  • 6. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | NoSQL Datenbanken – Eine Kategorisierung Key-Value Stores Bsp.: Oracle NoSQL DB Redis Document Stores Bsp.: MongoDB MarkLogic Column Stores / BigTable Bsp.: HBase Cassandra Graph Datenbanken Bsp.: Neo4J Oracle NoSQL + Graph 7 Abbildungen: http://www.thoughtworks.com/insights/blog/nosql-databases-overview
  • 7. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 Begriffe und Thematische Einordnung Kurzer Überblick zur Oracle NoSQL Datenbank Oracle NoSQL DB in der Praxis – Installation und Betrieb Oracle NoSQL DB in der Praxis – Anwendungsentwicklung Weiterführende Links und Informationen 9 5
  • 8. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle NoSQL Database • Basiert auf Oracle Berkeley DB Java Edition High Availability • Datenhaltung – ready for web scale – Hochverfügbarkeit per Replikation – Transparentes Loadbalancing – Konsistenz und Persistenz konfigurierbar (ACID <-> BASE) • Key-Value Datenhaltung als Basis – JSON, AVRO Support – Table API, Sekundärindexe • Einfache Installation, Einrichtung und Erweiterung • Läuft auf mehreren Knoten – Ausnahme: „Lite“ Version läuft auf nur einem Knoten
  • 9. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Die Basis: Was ist ein "Key-Value-Store"? • Ansammlung von Key-Value-Paaren in einem Store, verteilt auf Partitionen – Key – String, Major & Minor Key – Value – Byte Array • Identifikation über Key (oder Teile davon), Auslesen des Value • Einfache Zugriffe: GET, PUT, DELETE • Keine Standard-Abfragesprache wie SQL für RDBMS Key Value 010101010 0198287981A98721891209A0909109039810983A0919032093091A 010101011 Das ist ein Text, der als Value abgelegt ist … 000101010010111111010010101000111 Datenstrukturen sind nicht selbstbeschreibend Zeilen Key-Value Store CUSTOMERSKey = Index
  • 10. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle NoSQL Database Topologie Partition 1 Partition 2 Partition 3 Storage Nodes Load balancer Webserver Webserver Application Server NoSQLDB Treiber Application Server NoSQLDB Treiber R M R Application Server Webserver
  • 11. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 Begriffe und Thematische Einordnung Kurzer Überblick zur Oracle NoSQL Datenbank Oracle NoSQL DB in der Praxis – Installation und Betrieb Oracle NoSQL DB in der Praxis – Anwendungsentwicklung Weiterführende Links und Informationen 16 5
  • 12. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Die Oracle NoSQL DB in der Praxis Installation und Betrieb 1. Kurze Diskussion der Deployment Optionen 2. Voraussetzungen prüfen 3. Kapazitätsplanung 4. Installation durchführen 5. Zielarchitektur definieren 6. NoSQL DB Cluster aufsetzen 7. Cluster erweitern 8. Ein neues Data Center hinzufügen 18
  • 13. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Demo-Setup • „Spielwiese“ Oracle Big Data Lite VM v4.4.0 – Download: http://www.oracle.com/technetwork/databas e/bigdata-appliance/oracle-bigdatalite- 2104726.html – Benötigt VirtualBox (freie Desktop-Virtualisierung) – Vorinstallierte Software-Komponenten – Beispieldaten und –Skripte – Hands-On Labs Oracle Confidential – Internal/Restricted/Highly Restricted 19
  • 14. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 1: Deployment Optionen „Do-it-yourself“ NoSQL DB Cluster • Was muss beachtet werden – Hardware – Netzwerk – Sizing – Installation – Konfiguration – Deployment – Patchen – Load Balancing – ... Engineered Systems Ansatz • Oracle Big Data Appliance – Schnell einsetzbar, günstige TCO, skalierbar – Pre-integrated full rack configuration • Oracle's Sun x86 Servers • InfiniBand und Ethernet Connectivity – Vorinstallierte SW-Komponenten • U.a. NoSQL DB, Oracle R, Cloudera Enterprise Technology software including Cloudera CDH, Cloudera Manager, and Cloudera RTQ (Impala) – Perfekt ausbalanciert – Erweiterbar 20
  • 15. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 2: Voraussetzungen prüfen $ java –version java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) $ jps 3859 Jps $ 21 • Java SE Version 7 oder höher wird vorausgesetzt – Bezogen auf NoSQL Database 12cR1 • JPS (Java Virtual Machine Process Status Tool) – Standard-Werkzeug von Java SE • Empfehlung: NoSQL DB Knoten nicht auf virtuellen Maschinen installieren
  • 16. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 3a: Bestimmen der NoSQL DB Cache Größe • DBCacheSize Werkzeug je.jar in $KVHOME/lib • Input: – 1 Milliarde Sätze (K-V-Paare) – Durchschn. Schlüsselgröße 15 Bytes – Durchschn. Satzlänge 1 KB • Ergebnis im Beispiel: – 43 GB werden für das Cachen der Schlüssel im Hauptspeicher benötigt – Wieviel Hauptspeicher hat ein Storage Node? Wieviel davon wird für den Cache allokiert? Daumenregel -> ca. 60% 22 $ java -d64 -XX:+UseCompressedOops -jar $KVHOME/lib/je.jar DbCacheSize -records 1000000000 -key 15 -data 1024 === Environment Cache Overhead === 3,157,213 minimum bytes To account for JE daemon operation, record locks, HA network connections, etc, a larger amount is needed in practice. === Database Cache Size === Number of Bytes Description --------------- ----------- 43,126,658,112 Internal nodes only 1,113,239,107,552 Internal nodes and leaf nodes
  • 17. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 3b: Kapazitätsplanung für NoSQL DB • Ermitteln von – Anzahl der Storage Nodes – Replikationsfaktor – Anzahl der Partitionen • InitialCapacityPlanning Werkzeug – InitialCapacityPlanning.xls in $KVHOME/doc/misc 23
  • 18. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 4: Installation und Start auf einem Storage Node $ mkdir <path1>/kv $ cd <path1>/ kv $ cp <path2>/kv-ee-3.5.2.tar.gz . $ gunzip kv-ee-3.5.2.tar.gz $ tar xvf kv-ee-3.5.2.tar kv-3.5.2/ kv-3.5.2/doc/ ... $ cd kv-3.5.2 $ KVHOME=<path1>/kv/kv-3.5.2 $ export KVHOME $ mkdir –p $KVHOME/kvroot $ KVROOT=$KVHOME/kvroot $ export KVROOT $ java –jar $KVHOME/lib/kvstore.jar kvlite & Created new kvlite store with args: -root ./kvroot -store kvstore -host <host> -port 5000 -admin 5001 $ jps 6412 Jps 6302 kvstore.jar $ java -jar lib/kvstore.jar ping -host <host> -port 5000 Pinging components of store kvstore based upon topology sequence #14 10 partitions and 1 storage nodes 24 • Download-Seite – http://www.oracle.com/technetwork/database/databa se-technologies/nosqldb/downloads/index.html • 2 Editionen verfügbar – Community und Enterprise Edition • Zusätzliche Software-Komponenten – RDF Jena Adapter für NoSQL DB EE – Treiber: Java, C, JavaScript, Python • Installation auf jedem Storage Node notwendig – Verzeichnisname sollte überall identisch sein • Umgebungsvariablen KVHOME und KVROOT setzen
  • 19. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 5: Topologie für die NoSQL Datenbank definieren Lineare Skalierung und Replikation 25 • Elastic Auto Sharding (split, add, contract) Store Shard M Shard R R R R Application NoSQL Driver M • Writes to elected node with flexible durability • Reads from any node in system Shard R R M Expand and Rebalance Shard M R R • Auto re-balance of data on expansion
  • 20. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 6: 3x3 NoSQL Datenbank Cluster (1 Data Center) $ cd /u01/nosql/scripts $ ./makebootconfig.sh Killing Java processes ... kill 3446: No such process Deleting old directories... Creating new directories... Done bootstrapping storage-node 1 Done bootstrapping storage-node 2 Done bootstrapping storage-node 3 $ ./startSNA.sh $ jps –m 3761 ManagedService 3590 kvstore.jar 3591 kvstore.jar ... $ ./runScript.sh 3x3.kvs Connected to Admin in read-only mode Connected to Admin in read-only mode Store configured: kvstore Executed plan 1, waiting for completion... Plan 1 ended successfully Executed plan 2, waiting for completion... ... 26 1. Bootstrapping auf den 3 beteiligten Storage Nodes 2. Starten der Agenten auf den Storage Nodes 3. Deployment einer 3x3 Topologie auf den Storage Nodes 4. Überprüfen der Topologie http://localhost:5001/
  • 21. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 27
  • 22. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 7: Hinzufügen eines neuen Shards (3x3 -> 4x3) $ ./makebootconfig-sn4.sh Done bootstrapping storage-node 4 $ ./startSNA-sn4.sh $ ./runScript.sh 4x3.kvs Executed plan 9, waiting for completion... Plan 9 ended successfully Created 4x3 Redistributed: 4x3 Topology transformation from current deployed topology to 4x3: Create 1 shard Create 3 RNs Relocate 2 RNs Migrate 30 partitions ... Executed plan 10, waiting for completion... Plan 10 ended successfully $ 28 1. Bootstrapping auf neuem Storage Node 2. Starten des Agenten auf neuem Storage Nodes 3. Deployment einer 4x3 Topologie – Hinzufügen eines Storage Node zum Data Center – Klonen der Topologie – Redistribution: Neues Shard, Replikationsknoten, Verschieben der Partitionen, Rebalancing des Clusters 4. Überprüfen der Topologie http://localhost:5001/
  • 23. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 29
  • 24. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 8: Hinzufügen eines neuen Data Center (4x3 -> 4x4) $ ./makebootconfig-sn5.sh Done bootstrapping storage-node 5 $ ./startSNA-sn5.sh $ ./runScript.sh 4x4.kvs Executed plan 11, waiting for completion... Plan 11 ended successfully Executed plan 12, waiting for completion... Plan 12 ended successfully Created 4x4 Redistributed: 4x4 Topology transformation from current deployed topology to 4x4: Create 4 RNs ... Executed plan 13, waiting for completion... Plan 13 ended successfully $ java -jar /u01/nosql/kv-ee/lib/kvstore.jar runadmin - port 5000 -host kvhost01 kv-> show topology store=kvstore numPartitions=120 sequence=179 zn: id=zn1 name=Potsdam repFactor=3 type=PRIMARY zn: id=zn2 name=Berlin repFactor=1 type=PRIMARY 30 1. Bootstrapping auf neuem Storage Node 2. Starten des Agenten auf neuem Storage Nodes 3. Deployment einer 4x4 Topologie – Anlegen eines neuen Data Center – Hinzufügen eines Storage Node zum neuen Data Center – Klonen der Topologie – Redistribution: Neues Shard, Replikationsknoten, Verschieben der Partitionen, Rebalancing des Clusters 4. Überprüfen der Topologie http://localhost:5001/ oder über Kommandozeilenwerkzeug
  • 25. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted 31
  • 26. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 Begriffe und Thematische Einordnung Kurzer Überblick zur Oracle NoSQL Datenbank Oracle NoSQL DB in der Praxis – Installation und Betrieb Oracle NoSQL DB in der Praxis – Anwendungsentwicklung Weiterführende Links und Informationen 32 5
  • 27. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Die Oracle NoSQL DB in der Praxis Anwendungsentwicklung 1. Erste Schritte mit der NoSQL DB: HelloModernAppDev.java 2. NoSQL DB Table API 3. Mittels REST API auf die Oracle NoSQL DB 4. Oracle NoSQL DB als Graph Datenbank: Knoten und Kanten 5. NoSQL DB mit Oracle DB über externe Tabellen verbinden 34
  • 28. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 1: Ein HelloWorld-Beispiel mit der Java API $ cd $KVHOME $ java -jar $KVHOME/lib/kvstore.jar kvlite $ Opened existing kvlite store with config: -root ./kvroot -store kvstore -host <hostname> - port 5000 -admin 5001 $ # 2. Terminalfenster $ java -jar $KVHOME/lib/kvstore.jar ping -port 5000 -admin 5001 -host <hostname> $ cd $KVHOME $ gedit examples/hello/HelloModernAppDev.java $ javac -cp examples:lib/kvclient.jar examples/hello/HelloModernAppDev.java $ java -cp examples:lib/kvclient.jar hello.HelloModernAppDev Hello Modern App Dev 12c Community ! $ 35 • KVLITE – Auf Basis einer 1x1 Topologie • 1 Storage Node, 10 Partitionen • KVLITE starten • HelloModernAppDev.java – Kompilieren und ausführen – Key-Value Paare • CRUD Operationen: PUT, GET, DELETE • JavaDoc http://docs.oracle.com/cd/NOSQL/html/javado c/overview-summary.html
  • 29. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 2: Table API $ cd $KVHOME $ java -jar lib/kvstore.jar runadmin -port 5000 -host <hostname> kv-> table create -name EMP EMP-> add-field -type INTEGER -name empno EMP-> add-field -type STRING -name ename EMP-> add-field -type DOUBLE -name sal EMP-> add-field -type STRING -name job EMP-> primary-key -field empno EMP-> exit Table EMP built. kv-> plan add-table -name EMP -wait Executed plan 11, waiting for completion... Plan 11 ended successfully kv-> connect store -host localhost -port 5000 -name kvstore Connected to kvstore at localhost:5000. kv-> put table -name EMP -json '{"empno":815, "ename":"JONES", "sal": 3500, "job":"MANAGER"}' Operation successful, row inserted. ... kv-> get table –name emp kv-> get –kv all ... 36 • Nutzen des CLI • Operationen – PUT TABLE, GET TABLE • JavaDoc http://docs.oracle.com/cd/E57769_01/ht ml/javadoc/oracle/kv/table/TableAPI.htm l
  • 30. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 2: Table API – Tabellen im SQL Developer 37 • Verbindung auf NoSQL DB anlegen – Host: <hostname> – Store: kvstore • Navigation wie gewohnt • Nur Lese-Zugriffe – Tabellen – Daten
  • 31. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Oracle12c. Tabellen. Oracle12c. JSON Document Store. Oracle NoSQL DB Oracle REST Data Services (ORDS) Schritt 3: REST API für NoSQL DB
  • 32. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 3: Mit REST API auf NoSQL DB zugreifen $ cd /u01/ords $ java -jar ords.war standalone $ java -jar ords.war nosqladd --pagelimit 20 sales kvstore localhost:5000 $ // Browser http://localhost:7070/ords/sales/metadata-catalog http://localhost:7070/ords/sales/metadata- catalog/tables/emp/ http://localhost:7070/ords/sales/metadata- catalog/tables/emp/item http://localhost:7070/ords/sales/tables/emp http://localhost:7070/ords/sales/tables/emp/7999 curl -i -H "Content-Type: application/json" -X PUT -d "{"empno": 8000, "ename": "PATENGE", "job": "Consultant"}" "http://localhost:7070/ords/sales/tables/emp/" http://localhost:7070/ords/sales/tables/emp/8000 39 • ORDS installieren und konfigurieren • Hier: Starten als Standalone • NoSQL DB Store registrieren • Auf Metadaten-Katalog zugreifen • Auf Metadaten einer spezifischen Tabelle zugreifen • Auf Tabellendaten zugreifen – Über Schlüssel • CRUD • Hinweis: JSON-Anzeige im Browser – Hier: Plug-in für Firefox
  • 33. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Schritt 4: Oracle NoSQL DB als Graph Datenbank $ cd /opt/oracle/oracle-spatial- graph/property_graph/dal/groovy $ ./gremlin-opg-nosql.sh opg-nosql> // Connect to the Oracle NoSQL DB opg-nosql> server = new ArrayList<String>(); opg-nosql> server.add("bigdatalite:5000"); ==>true opg-nosql> cfg=new PgNosqlGraphConfigBuilder() opg-nosql> .setDbEngine(DbEngine.NOSQL) opg-nosql> .setName("helloWorldGraph") opg-nosql> .setStoreName("kvstore") opg-nosql> .setHosts(server) opg-nosql> .addEdgeProperty("label", PropertyType.STRING, "label") opg-nosql> .setMaxNumConnections(1).build(); ... • Knoten-Kanten-Modell – Knoten und Kanten mit Attributen • In-Memory Parallel Graph Analysis – PGX Framework – Beispiel mit Groovy Shell • Teil von Oracle Big Data Spatial and Graph vertex1 vertex2 edge1 name: ″ Karin ″ location: ″Potsdam″ gender:“female“ name: ″Carsten″ location: ″Munich″ isColleagueOf
  • 34. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 Begriffe und Thematische Einordnung Kurzer Überblick zur Oracle NoSQL Datenbank Oracle NoSQL DB in der Praxis – Installation und Betrieb Oracle NoSQL DB in der Praxis – Anwendungsentwicklung Weiterführende Links und Informationen 45 5
  • 35. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | NoSQL DB Enterprise Edition und Community Edition Feature NoSQL DB CE NoSQL DB EE Lizenzkosten Verfügbar unter der AGPL License R MyOracleSupport R R Diskussionsforen R R Open Source R Java und C API R R ACID Transaktionen R R Large Object Support R R Kein Single Point Of Failure R R
  • 36. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | NoSQL DB Enterprise Edition und Community Edition Feature NoSQL DB CE NoSQL DB EE Integation mit Hadoop R R Table API R R RDBMS Integration Ext. Tables R Jena Adapter (Graph/SPARQL) R Event Processing (CQL) R Online Administration R R JMX Monitoring R R SNMP Monitoring R
  • 37. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Hilfreiche Informationen und Links • Öffentlich verfügbare Inhalte – Oracle Oracle NoSQL im OTN http://www.oracle.com/technetwork/database/database- technologies/nosqldb/documentation/index.html – Online Dokumentation http://docs.oracle.com/cd/NOSQL/html/index.html – JavaDoc der Java API http://docs.oracle.com/cd/NOSQL/html/javadoc/index.html – Wieviel Storage Nodes werden benötigt – Ressourcen planen für die Oracle NoSQL DB: http://docs.oracle.com/cd/NOSQL/html/AdminGuide/Oracle-NoSQLDB-Admin.pdf#page=16 – Oracle Big Data Lite VM http://www.oracle.com/technetwork/community/developer-vm/index.html#bdl – Oracle Dojo # 2 zu „Big Data: Eine Einführung in Oracle NoSQL DB, Hadoop MapReduce, Oracle Big Data Connectors“ http://www.oracle.com/webfolder/technetwork/de/community/dojo/index.html – Blog von Charles Lambs https://blogs.oracle.com/charlesLamb/ – Vortrag metafinanz Informationssysteme GmbH auf DOAG Konferenz 2013 http://www.metafinanz.de/sites/default/files/DOAG_2013_Oracle NoSQL Database.pdf 50
  • 38. Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 51