Oracle Cloud Hangout Cafe(おちゃかふぇ)のセッションスライドです。 #ochacafe
(セッションの録画) https://youtu.be/otNGEAQvTmI
(イベントページ) https://ochacafe.connpass.com/event/193638/
NoSQLKyotaro NonakaTechnology Solutions ArchitectOracle Corporation JapanNovember 25th, 2020
View Slide
Copyright © 2020, Oracle and/or its affiliates2
NoSQLCopyright © 2020, Oracle and/or its affiliates3
4 Copyright © 2020, Oracle and/or its affiliates1.2. NoSQL3. /4. NoSQL
••• EC• OCHaCafe 3 4•Copyright © 2020, Oracle and/or its affiliates5@non_kyon
Copyright © 2020, Oracle and/or its affiliates6NoSQL RDBMS
RDBNoSQL RDBCopyright © 2020, Oracle and/or its affiliates7
RDB⇒RDBNoSQL⇒ NoSQLRDB NoSQLCopyright © 2020, Oracle and/or its affiliates8
RDB• /• /•••9RDBMS NoSQL
SQL(RDB)NoSQL Not Only SQL••10DocumentKVSkey valuekey valuekey valueNoSQL
NoSQLCAPCAP•32•••Copyright © 2020, Oracle and/or its affiliates11CAPAvailability( )Consistency( )(Partition Tolerance)CAOracle, MySQL,Postgres etc…APDynamoDB,Cassandra etc…CPMongoDB,HBase etc…
CA• (C) (A)• 2(P)CP• (C) (P)•AP• (A) (P)•Copyright © 2020, Oracle and/or its affiliates12CAPAvailability( )Consistency( )(Partition Tolerance)CAOracle, MySQL,Postgres etc…APDynamoDB,Cassandra etc…CPMongoDB,HBase etc…
NoSQLCopyright © 2020, Oracle and/or its affiliates13
Copyright © 2020, Oracle and/or its affiliates14
Copyright © 2020, Oracle and/or its affiliates15※Redis Coherence …
•• /• SPOF CP( CA )• JSON-like••• MongoDB Value• OSS OnP/IaaS••Copyright © 2020, Oracle and/or its affiliates16databaseCollectionDocumentDocumentDocumentRDBRDB
shardCopyright © 2020, Oracle and/or its affiliates17LoadBalancerApp mongosApp mongosmongodmongodmongodmongodmongodmongodmongodmongodmongodshard1shard3shard21 2 3
Copyright © 2020, Oracle and/or its affiliates18Document(JSON ) -MongoDB-OnP/IaaS/Managed AtlasShardingTTLGUI Compass( ) Robo 3Tmongo-express
Copyright © 2020, Oracle and/or its affiliates19databasecollectionqueryquery
DocumentDocumentDocumentDocumentCopyright © 2020, Oracle and/or its affiliates20..insert(<{Document}>)..find()..findOne() //1..update(,{$set: {: }})..remove()
• ( )• GUI MongoDB Compass•••••Copyright © 2020, Oracle and/or its affiliates21
• Facebook OSS NoSQL• KVS• CAP AP• Table Key Value Row•••• SQL-like CQL•••Copyright © 2020, Oracle and/or its affiliates22KeyspaceTableRow Column1PartitionKey1 ValueColumn2arr[v,…]Column3map{k:v,…}Row Column1PartitionKey2 ValueColumn2arr[v,…]Column3map{k:v,…}Row Column1PartitionKey3 ValueColumn2arr[v,…]Column3map{k:v,…}
• Partition Key•• PartitionClustering KeyCopyright © 2020, Oracle and/or its affiliates23
Copyright © 2020, Oracle and/or its affiliates24KVS -CQL --OnP/IaaS/Managed AWS (Amazon MCS)( )GUI Table Plus-
1. String CQL2. QueryBuilder CQL3. PreparedStatement CQLCopyright © 2020, Oracle and/or its affiliates25
CQL• / (=, >, <, >=, <=)• IN• LIKE• ORDER BY• GROUP BY• LIMITCQL• !=• NOT• OR• IS NULL/ IS NOT NULL NULL• JOIN• OFFSETCopyright © 2020, Oracle and/or its affiliates26SQL
••••••Copyright © 2020, Oracle and/or its affiliates27CQL RDB
• Oracle NoSQL• KVS Document(JSON)• CAP APC• KVS•• (KVS)/ (JSON)• API/SQL• /• OracleCopyright © 2020, Oracle and/or its affiliates28Integer(key)String(data)String(data)Json(data)num1 string1 string1 json1num2 string2 string2 json2num3 string3 string3 json3num4 string4 string4 json4DATACAPACITY PROVISIONEDSTORAGEREADWRITENoSQL Table
Copyright © 2020, Oracle and/or its affiliates29KVS/Document -API/SQL -JSONManaged -ACIDorder by, group by (table 5 )GUI OCIOCI
Copyright © 2020, Oracle and/or its affiliates30(OCI IAM )request
••• Not Null/Nullable• JSONDocument• API(NoSQL SDK/OCI SDK) + SQL• / /Copyright © 2020, Oracle and/or its affiliates31RDB
• Hadoop OSS•• MongoDB CPCA• Table Row Row key Column QualifierColumn Qualifier Column Family•••• API•Copyright © 2020, Oracle and/or its affiliates32NamespaceTableRow KeyColumn Family Column FamilyQualifier Qualifier Qualifier QualifierRow1 value1 value2 value3 value4Row2 value5 value6 value7 value8…
• Region: HBase Region•• Region Server: Region HDFS +•• Row Key, Column Family, Column Qualifier key ValueCopyright © 2020, Oracle and/or its affiliates33RowKeyCF1 CF2CQ1 CQ2 CQ3 CQ4Row1 value1 value2 value4Row2 value5 value7 value8Row Key CF CQ ValueRow1 CF1 CQ1 value1Row1 CF1 CQ2 value2Row1 CF2 CQ4 value4Row2 CF1 CQ1 value5Row2 CF2 CQ3 value7Row2 CF2 CQ4 value8HDFSRegionServerRegionRegionServerRegionHBaseClient
Copyright © 2020, Oracle and/or its affiliates34-API Apache Phoenix SQLOnP/IaaS -Region ServerOCC:(Row Key > CF > CQ > Timestamp)GUI HUE: HadoopHUE: Hadoop
Copyright © 2020, Oracle and/or its affiliates35
• MySQL (V5.7~)• Document(JSON)• MySQL RDBMS CA• JSON•• API/SQL•• OCICopyright © 2020, Oracle and/or its affiliates36
Copyright © 2020, Oracle and/or its affiliates37Document -API/SQL --OnP/IaaS/Managed -- MySQLACIDGUI MySQL Workbench( )MySQL Workbench/OCI
•••••• X DevAPI: X APIDocumentStore API• X DevAPI CRUD• Collection ⇒add(), find(), modify(), remove()• Table ⇒insert(), select(), update(), delete()Copyright © 2020, Oracle and/or its affiliates38SQLX DevAPIWHERE ->”$. ” =
• Oracle Database Document1• JSON• RDBMS CA• JSON•••• SODA NoSQL API /SQLCopyright © 2020, Oracle and/or its affiliates39id col1 col2 json… … …… … …… … …
Copyright © 2020, Oracle and/or its affiliates40DocumentAPI/SQL -ManagedAuto ScalingACIDJSON Search IndexGUI SQL Developer WebFree Tier (ATP/ADW JSON )OCI
• SQL Developer Web• SODA(NoSQL API) SQL•••Copyright © 2020, Oracle and/or its affiliates41SQL MongoDB
Copyright © 2020, Oracle and/or its affiliates42
• NoSQL••••••••••Copyright © 2020, Oracle and/or its affiliates43:表書
Copyright © 2020, Oracle and/or its affiliates44MongoDBAggregationCassandraOracle NoSQLHBaseMySQLJSON_TABLE()AJDJSON_*AGG()
MongoDBCopyright © 2020, Oracle and/or its affiliates45
• ( )• GUI MongoDB Compass•••••Copyright © 2020, Oracle and/or its affiliates46
JSON••••••••Copyright © 2020, Oracle and/or its affiliates47ID SNS_ID0001A000010002B00002{“entities”: {“hashtags”: [],“user_mentions”: [“screen_name”: …,]}}: SNSID JSON00001 json00002 json
Copyright © 2020, Oracle and/or its affiliates48Document /MongoDBCassandraOracle NoSQLHBaseMySQLAJD
Autonomous JSON DatabaseCopyright © 2020, Oracle and/or its affiliates49
• SQL Developer Web• SODA(NoSQL API) SQL•••Copyright © 2020, Oracle and/or its affiliates50SQL MongoDB
NoSQL•••••••Copyright © 2020, Oracle and/or its affiliates51ID SNS_ID0001A000010002B00002{“entities”: {“hashtags”: [],“user_mentions”: [“screen_name”: …,]}}: SNSID JSON00001 json00002 json
Copyright © 2020, Oracle and/or its affiliates52MongoDBMongoDBDocumentCassandraCQLKVSOracle NoSQLAPI + SQLKVS/DocumentHBaseAPI + (SQL) HDFSMySQLSQL MySQLDocumentAJDSQL (SODA) Oracle DatabaseDocument
MySQL Document StoreCopyright © 2020, Oracle and/or its affiliates53
•••••• X DevAPI: X APIDocumentStore API• X DevAPI CRUD• Collection ⇒add(), find(), modify(), remove()• Table ⇒insert(), select(), update(), delete()Copyright © 2020, Oracle and/or its affiliates54SQLX DevAPIWHERE ->”$. ” =
• NoSQL••••••••Copyright © 2020, Oracle and/or its affiliates55NoSQLWeb App
Copyright © 2020, Oracle and/or its affiliates56MongoDBShardingCassandraOracle NoSQLAggregate ExpressionsHBaseRegionMySQLAJDAuto Scaling
CassandraCopyright © 2020, Oracle and/or its affiliates57
••••••Copyright © 2020, Oracle and/or its affiliates58CQL RDB
• NoSQL•••••••••Copyright © 2020, Oracle and/or its affiliates59frontNoSQLServerbackend
TTLMongoDBremoveCassandraOracle NoSQLHBaseMySQLAJD(Oracle Database)Copyright © 2020, Oracle and/or its affiliates60
1. Oracle NoSQL Database(CS)2. /• API Gateway Functions Object Storage HTML• Oracle NoSQL SessionID(TTL )••Copyright © 2020, Oracle and/or its affiliates61API Gatewayuser_id passwordochacafe ochacafe1234…user_id session_idochacafe …HTMLFunctions
62 Copyright © 2020, Oracle and/or its affiliates
Our mission is to help people seedata in new ways, discover insights,unlock endless possibilities.