Oracle NoSQL Database Cloud Service is now available as part of Always Free Resources in Oracle Cloud Infrastructure (OCI Gen 2). You can now build and implement your next exciting Internet of Things(IoT), E-commerce, real-time gaming and, product catalog applications anytime on a fully managed NoSQL Database cloud service.
In this blog, I am going to cover everything about NoSQL Database Cloud Service and how to create tables in NoSQL databases in Oracle Cloud.
- What is NoSQL Database?
- Why NoSQL?
- NoSQL vs SQL
- Oracle NoSQL Database Cloud Service & Key concepts
- Using Console to Manage Tables
- NoSQL Database Common Use Cases
- Oracle NoSQL Database Cloud Simulator
- Oracle NoSQL Migrator
If you don’t have an Oracle Cloud Account yet, follow our blog for quick steps on How to Register For FREE Oracle Cloud Trial Account.
What Is NoSQL Database?
NoSQL databases originally refer to as “non-SQL” or “non-relational” databases. They are also known as “Not Only SQL” which is an alternative to SQL database which does not require any kind of fixed table schemas, unlike SQL. NoSQL database allows storing data of any data type: structured, semi-structured, and unstructured data.
If you are a beginner and want to know more about Databases in Oracle Cloud, check out our blog Databases In Oracle Cloud (OCI) – VMDB | BMDB | ExadataCS
NoSQL Database supports databases with different types of data. The most popular types are:
- Key-value Store (Oracle NoSQL, Redis, Amazon Dynamo)
- Document-Based Store (MongoDB and Couchbase)
- Column-based Store (Google’s Bigtable, Cassandra, HBase)
- Graph databases (Neo4j)
Why NoSQL?
NoSQL database was initially used by top internet companies like Amazon, Google, LinkedIn, and Facebook to overcome the drawbacks of RDBMS. RDBMS is not always the best solution for all situations as data processing requirements grow exponentially. NoSQL provides a dynamic and more cloud-friendly approach to process unstructured data easily.
NoSQL vs SQL Databases
Modern application developers have many choices when faced with deciding when and how to persist a piece of data. While SQL databases are great at solving traditional application problems like data normalization, strictly consistent data, and complex queries to access that data, NoSQL databases turn out to be great at processing unstructured data dynamically.
1) NoSQL is not a replacement for RDBMS.
2) SQL databases are relational, NoSQL databases are non-relational.
3) SQL databases use structured query language and have a predefined schema. NoSQL databases have dynamic schemas for unstructured data.
4) SQL databases are better for multi-row transactions, NoSQL is better for unstructured data like documents or JSON.
5) Most SQL databases require you to scale-up vertically, NoSQL databases allow you to scale-out horizontally.
6) Queries in NoSQL databases can be faster than SQL databases.
Oracle NoSQL Database Cloud Service
NoSQL Database Cloud Service is part of the Oracle Cloud Free Tier services. Each tenant can have up to three Always Free NoSQL tables in tenancy. You can have both Always Free and regular tables in the same tenancy.
The Oracle NoSQL Database Cloud Service is a server-less, fully managed data store that delivers predictable single-digit response times and allows applications to scale on-demand via provisioning API calls. It has the ability to handle JSON documents, columnar, or key-value data models.
The Oracle NoSQL Database Cloud Service provides key features for the developers:
- Developer-Centric: NoSQL Database Cloud Service is designed for flexibility. It supports different types of data models: document-based (JSON), fixed-schema, and key-value.
- Open: The service can work with both document-based and fixed-schema data models. Users can deploy and run the same application in the cloud or on-premises, with no platform lock-in.
- Ease and Simplicity: With an available SDK and support for various languages such as Python, Go, Node.js, and Java, Oracle NoSQL Cloud made application development easier. You can develop and deploy an application in minutes by using a simple graphical user interface.
- Elastic Scalability: The service scales to meet application throughput performance requirements while maintaining low and predictable response times.
- Failsafe high availability of 99.95% with instant automatic failure detection and failover to protect your applications against unplanned downtime, outages, and data loss.
How Does It Work?
There are four simple steps to getting started with the Oracle NoSQL Database Cloud Service.
- Download the Oracle NoSQL Database driver.
- Connect your application to the NoSQL Database Cloud Service
- Create a table with provisioned reads and write capacity, and disk storage
- Read data from and write data to the table.
NoSQL Database Key Concepts
Your NoSQL application uses tables to organize data, so let’s discuss some key concepts required to design and configure tables in Oracle NoSQL Database Cloud Service.
Table
A table is a collection of rows, where each row holds a data record. Each table row or record consists of key and data fields, which are defined at the time of table creation. Tables are created using Data Definition Language (DDL) that defines the data types and primary keys used for the table.
- Table Fields: Table columns are referred to as fields. Each table field has a data type such as numeric, string, binary, timestamp, maps, arrays, records, and a special JSON type that can hold valid JSON data.
- Primary Keys: Every table must have a primary key that uniquely identifies every row in a table.
- Shard Keys: Shard keys are used to distribute data across the NoSQL Database cluster for increased efficiency.
- Indexes: By creating an index, you can more efficiently retrieve rows based on fields other than the primary key.
- Capacity: When you create a table, you also specify throughput and storage resources available for the table.
- Time to Live (TTL): It allows you to automatically expire table rows. Data that has expired can no longer be retrieved and does not appear in any read operations.
Check out our blog if you want to know more about Database Sharding.
Using the Console to Manage Tables
Let’s see how to manage Oracle NoSQL Database Cloud Service tables using the console.
Creating a Table
You can create new Oracle NoSQL Database Cloud Service tables from the cloud console in two modes:
- Simple Input Mode: This mode is used to create the table declaratively, that is, without writing a DDL statement.
- Advanced DDL Input Mode: This mode is used to create the table using a DDL statement.
In this blog, we will see how to create a table from the NoSQL console by using the Simple Input table creation mode.
1) Access cloud console, open navigation menu, under Database, click on NoSQL Database.
2) Click Create Table. In the Create Table dialog, select Simple input for Table Creation Mode. Enter the appropriate capacity values for read capacity, write capacity, and disk storage.
3) In the Name field, enter a table name. In the Primary Key Columns section, enter primary key details. Click Create Table.
4) Once the table is created, it will be listed in the NoSQL console.
Inserting Data into Tables
You can insert data into Oracle NoSQL Database Cloud Service tables from the cloud console in two modes:
- Simple Input Mode: This mode is used where you provide the values for the new rows declaratively.
- Advanced JSON Input Mode: This mode is used where you provide the values for the new rows in JSON format.
In this blog, we will see how to insert data into tables from the NoSQL console by using the Simple Input Mode.
1) Access cloud console, go to NoSQL console page, click the table name.
2) On the table details page, click Insert Row.
3) In the Insert Row window, select Simple Input for Entry Mode. Enter values for all the columns listed here. Click Insert Row.
NoSQL Database Common Use Cases
1) Personalization
It helps build rich, personalized user experiences with faster response times. It helps you deliver content customized to individual users’ preferences.
2) Mobile applications
It helps build modern, scalable, and responsive apps for mobile devices.
3) Real-time fraud detection
It helps processing transactions and detects any fraudulent activity in real-time with a fast response time.
4) Internet of Things (IoT)
It helps build fast and scalable IoT applications that require processing high-volume data bursts from device sensors and real-time analytics.
5) Gaming
It supports real-time gaming with millions of concurrent players with real-time status and game state while simultaneously retrieving or updating the game data with single-digit millisecond response times.
NoSQL Database High Availability
Oracle NoSQL Database Cloud Simulator
Would you like to build your Oracle NoSQL Database cloud Java application locally before migrating it to the Oracle cloud?
Oracle provides a tool for accelerating your Oracle NoSQL Database cloud application development and testing with the Oracle NoSQL Database Cloud Simulator. The Cloud Simulator or “cloudsim” allows you to create, debug, and test your application against a locally deployable database instance with all functionality similar to the actual Oracle NoSQL Database cloud service. When you are ready to run your application on production on Oracle Cloud, all that is needed is to change the endpoint from cloudsim to the cloud service endpoint with the right authentication and authorization credentials.
To start working with Oracle NoSQL Database Cloud Simulator, you would need the Oracle NoSQL Cloud SDK and the Oracle NoSQL Cloud Java Driver. These can be downloaded from the official Oracle download page.
Oracle NoSQL Migrator
Oracle NoSQL Data Migrator is a tool that is used for data migration or it supports the movement of Oracle NoSQL tables from one data source to another.
This utility supports multiple migration options, such as:
- Oracle NoSQL Database on-premise to Oracle NoSQL Database Cloud Service and vice-versa
- Between two Oracle NoSQL on-premise Databases
- Between two Oracle NoSQL Database Cloud Service Tables
- JSON file to Oracle NoSQL Database on-premise and vice-versa
- JSON file to Oracle NoSQL Database Cloud Service and vice-versa
- MongoDB-formatted JSON file to an Oracle NoSQL Database table on-premise or cloud
NoSQL Data Migrator utility acts as a connector or pipe between the data source and the target (sink). This utility takes data from a selected source and imports that data into the target. It is a table-oriented tool, which means you can move the data only at the table level. A single migration task imports a single table only.
Read more about migration on our blog Oracle Database Migration To Cloud (Lift & Shift)
Related/References
- MySQL Database Service In Oracle Cloud
- Oracle Cloud Database Deployment Options (VMDB, BMDB, ExaCC, ExaCS & Autonomous (ADW, ATP)
- Overview of Autonomous Databases – Oracle Serverless Database
- [New Update] Oracle Database 21c Now Available On Oracle Cloud (OCI)
- [1Z0-1044] Oracle Cloud Platform Data Management 2020 Associate
Next Task For You
We cover NoSQL Database Cloud Service in our DBA To Cloud DBA training along with how to manage tables, connecting Applications, Table Design, Table States and Life Cycles, Oracle NoSQL Database Cloud Simulator, and Oracle NoSQL Migrator including the hands-on labs you must perform to clear [1Z0-1044] Oracle Cloud Platform Data Management 2020 Associate Certification.
Begin your journey towards becoming a Cloud DBA Expert by joining the FREE MasterClass.
Click on the below image to Register for the FREE Class Now!
The post NoSQL Database Service In Oracle Cloud appeared first on Cloud Training Program.