X

All Things Database: Education, Best Practices,
Use Cases & More

What Is NoSQL Database?

The database world is changing fast, with new advances that are completely transforming the way organizations use massive amounts of. Today, we’re announcing the availability of Oracle NoSQL Database Cloud, the latest addition to the Oracle Database portfolio.

Try NoSQL Database today - free

Developers can now focus on application development without dealing with the hassle of managing:  

  • Back-end servers
  • Storage expansion
  • Cluster deployments
  • Software installation
  • Patches
  • Upgrades
  • Backup
  • Operating systems
  • High-availability configurations

They can quickly provision throughput as application workload demands change dynamically and create modern applications without the complexities of maintaining a server or storage.

Watch the video to learn more. 

What does this mean?

It’s a new era for developers.

Picture this. With NoSQL Database, developers can now easily develop and deploy applications that respond to inquiries incredibly fast, such as:

  • UI personalization
  • Shopping carts
  • Online fraud detection
  • Gaming
  • Online Advertising
  • And much more

NoSQL Database can do this because it is:

  • Modern: A developer-oriented solution, Oracle NoSQL Database is designed for flexibility. The database supports key value APIs, including a simple declarative SQL API and command line interfaces along with flexible data models for data representation including relational and ad-hoc JSON.
  • Open: The database features innovative SQL interoperability between fixed schema and ad-hoc JSON data models. Users also have deployment options to either run the same application in the cloud or on-premises with no platform lock-in.
  • Easy: With an available SDK and support for popular languages including Python, Node.JS, and Java, Oracle offers a no-hassle application development solution to connect easily to the Oracle NoSQL Database Cloud. 

What Does NoSQL Database Do?

Oracle NoSQL Database scales to meet dynamic application workload throughput and storage requirements. Users create tables to store their application data and perform CRUD operations.

A NoSQL Database table is similar to a relational table with additional properties like provisioned write units, read units, and storage capacity. Users provision the throughput and storage capacity in each table based on the anticipated workloads. NoSQL Database resources are allocated and scaled accordingly to meet the workload requirements.

Read Units come in two flavors, Absolute Consistency and Eventual Consistency. Use Absolute Consistency when you need the most recently updated data and Eventual Consistency when you can use slightly older data. Users are billed hourly based on the throughput capacity and storage that is provisioned.

Oracle has made the development environment simple to use to develop applications for NoSQL Database. The application resides as a client which connects to the cloud service. NoSQL Database uses the https protocol to connect these two independently running processes.

To connect the client to the server, the following snippet of Java code is needed:

 URL serviceURL = new URL("http", hostname, port, "/");
 NoSQLHandleConfig config = new NoSQLHandleConfig(serviceURL);

The “hostname” is called the Service URI and points to a specific region that identifies where NoSQL Database  is running. The first release of NoSQL Database resides in the east coast region of the United States, hence the URI must be “ans.uscom-east-1.oraclecloud.com “.

How To Get Started with NoSQL Database

The Java driver can be used by application developers that wish to connect directly to the production service for application development. In addition, we provide a simulator of NoSQL Database which can be run locally.  The Oracle NoSQL Cloud Simulator is easily installed on a local machine such as a Linux VM running on a laptop. A simple script is available that starts up the Oracle NoSQL Cloud Simulator. The download is available on OTN.

How to Provision a Table with NoSQL Database

As mentioned earlier, users must provision the table they will use to store their data by specifying the maximum amount of write performance the application will require, the maximum amount of read performance the application will require, as well as the size of the table in terms of gigabytes. The write and read amounts are specified as Write Units and Read Units.

  • Write Unit per Month: The throughput of up to 1 kilobyte (KB) of data per second for a write operation over a month, approximately 2.6 million writes.
  • Read Unit per Month: The throughput of up to 1 kilobyte (KB) of data per second for an eventually consistent read operation over a month, approximately 2.6 million reads.

To achieve the throughput of up to 1 kilobyte (KB) of data per second for an absolute consistent read, the equivalent of two eventual consistent read units need to be provisioned.

A more detailed discussion of pricing will be in a future blog. Specific pricing and estimates of your monthly usage can be obtained by visiting the Oracle Cloud Cost Estimator.

Once the workload requirements for Write Units, Read Units, and amount of database storage has been determined for your specific application, the following Java code snippet is how the table would be provisioned:

 TableRequest tableRequest = new TableRequest()
 .setStatement("create table if not exists USERS(id integer, " +"name JSON, primary key(id);
 .setTableLimits(new TableLimits(100, 50, 150));
 TableResult tres = handle.tableRequest(tableRequest);

In the above example, a Table is requested that is provisioned with 100 Write Units, 50 Read Units, and 150 GB of storage. These are the initial values that the application will be able to use.

The following Java code example shows how to insert a small JSON datatype into a table:

private final static String JSON_DATA = "{" +
 " \"userdata\": [" +
 " {" +
 " \"id\": \"1\"," +
 " \"name\": \"Julie Sherman\"," +
 " \"gender\" : \"female\"," +
 " \"Age\" : \"25\"" +
 " }" +
 " ]" +
 "}";

 MapValue value = new MapValue()
   .put("id", 1)
   .putFromJson("name", JSON_DATA, null);

 putRequest = new PutRequest()
   .setvalue (value)
   .setTableName("users");
 putRes = handle.put(putRequest);

Over time, your workload may increase which means that the Write Units, Read Units, or Storage amount may need to increase as well. In some cases, depending on the workload, these values might need to be decreased as well. The following Java code example changes the values for TableLimits to 2000, 100, and 500.

TableRequest tableRequest = new TableRequest()
       .setTableName(“users”)
       .setTableLimits(new TableLimits(2000, 100, 500))
       .setTimeout(1000);
 TableResult res = conn.tableRequest(tableRequest);

A Benefit of a NoSQL Database in the Cloud

One of the most important aspects of the cloud service is the ability to increase or decrease the provisioned throughput based on the workloads. For example see figure 1, if your application exhibits time of day or day of week peak throughput patterns, you can modify the provisioned throughput of your application to meet those demand peak times and lower your provisioned throughput when demand tapers off. This means you only pay for the peak throughput when it is needed.

A dynamic workload like this may be seen in a shopping site during some peak buying seasons or for any application that has periodic workload changes. As your workload decreases, there is no need to use your Oracle cloud credits to maintain the throughput at the peak demand level. Your application can recognize the decreased demands and scale back, thus saving your company operational expenses. While all this is happening, your latency remains consistent.

Advantage of Cloud NoSQL Database

Figure 1 - Changes in throughput as workload changes

Summary

Oracle NoSQL Database solves a broad range of application problems frequently prevalent in modern applications. With support for predictable, low latency access to key/value data and rich JSON query experience, it’s ideal for UI personalization, real time fraud detection, and IoT data management applications.

Developers can quickly change the provisioned throughput based on workload demands. The API for NoSQL Database is simple to use and flexible in terms of the types of data that can be stored. The predictable latencies will appeal to any developer who is creating an application in which users require fast interaction.

As a fully managed service, developers and organizations can concentrate on creating innovative applications without the hassle of maintaining a server, storage, and network infrastructure.  More information can be found on the NoSQL Database webpage. To get started and see what NoSQL Database can do for you, start your free trial today

For more information, download:

Whitepaper: Flexible Data Models. Zero Administration. Automatic Scaling.

Whitepaper: Oracle NoSQL Database Cloud

Whitepaper: Capacity Planning for Oracle NoSQL Database Cloud

Written by Michael Schulman and Michael Brey

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services