
This blog is part 2 of a multi-part series on how to power your event-driven applications with Oracle NoSQL Database Cloud Service.
In the previous blog, we looked at the challenges that businesses face in today’s competitive environment. Enterprise stakeholders and business applications need to take actions immediately when certain events occur, such as seizing a sales opportunity, gathering a metric, resolving an issue, or initiating a business workflow. I went through a very simple use case in the following picture. A business owner identifies a new opportunity that requires storing new customer analysis information in a new Oracle NoSQL Database table. The creation of the new table automatically triggers an event that sends notifications to the stakeholders and downstream business applications, to start monitoring the new incoming data and engaging customers with new marketing campaigns. I also walked through the setup process for Oracle Events, and Oracle Notifications services.

This blog describes how to create a new table in Oracle NoSQL Database Cloud Service, which will trigger an event and send a notification to my email. The following picture shows a sequence of processes that follows after an event is triggered.

Before we begin, here’s a quick overview of the Oracle services we will be using.
- Oracle Events service enables users to create automation based on the state changes of resources in their tenancies, e.g., a state change in a NoSQL Database resource. Users subscribe to these changes and react to them using Oracle Functions, Oracle Notifications, or Oracle Streaming services.
- Oracle Notifications service broadcasts messages to distributed components through a publish-subscribe pattern – delivering secure, highly reliable, low latency, and durable messages for applications hosted on Oracle Cloud.
- Oracle NoSQL Database Cloud Service is a serverless, fully managed NoSQL data store that delivers predictable single-digit millisecond response times at massive scale. Applications built with this service can scale on-demand based on the workload. It supports document, fixed schema, and key-value data models. Developers can focus on application development without worrying about managing the underlying servers, storage, cluster deployments, software installation, or backup.
Recap on Service Configurations
We configured the “Service Name” and “Event Type” with NoSQL and Table – Create Begin in Oracle Events service in the previous blog. This configuration will trigger an event when a new table is created in Oracle NoSQL Database Cloud Service.

We also configured the “Action Type” and “Topic” with Notifications and NoSQLcreatetableTopic in Oracle Events service. This configuration will send an event message to the topic whenever an event is triggered.

Also, NoSQLcreatetableTopic was created as a “Topic” in the Oracle Notifications service, which will broadcast messages through a publish-subscribe pattern. The subscription to the topic was configured with Email protocol and my email address.
Trigger an Event
Let’s trigger an event by creating a new table in Oracle NoSQL Database Cloud Service.
Create a new table
1: Click on NoSQL Database from the OCI console to start using Oracle NoSQL Database Cloud Service.

2: You will see a list of NoSQL tables you have created. The list will be empty if this is the first time you use the service. Click on Create table to start creating a table.

3: Complete the “Reserved Capacity” section. Fill in the “Name” field with your table name and complete the “Primary key columns” and “Columns” sections. Click on Create table to create the new table.

4: You will be brought back to the list of NoSQL tables screen. It takes a few seconds to create the new table. You should see your table on the list when the process is done.

5: When myTable becomes Active, I will receive the following email in my Inbox from the Oracle Notifications service. The email title should say the “eventType” is “nosql.createtable.begin”.

Oracle NoSQL Database, Events, and Notifications Services In Action
So far, we experienced the following chain of activities when a new NoSQL table was created.

Let’s dive into the diagram below with details on how these services are chained together to enable this integration. In the Events service, the “Service” and “Event Type” rules were configured with NoSQL and Table – Create Begin, integrating the NoSQL and Event services. This will trigger an event when a new NoSQL table is being created. The “Action” and “Topic” rules were configured with Notifications and NoSQLcreatetableTopic, integrating the Events and Notifications services. When an event occurs, all event messages will be published to the Notifications service topic.
In the Notifications service, NoSQLcreatetableTopic was configured with Email as the subscription protocol with my email address. Whenever the Events service publishes a message to the topic, I will receive an email.
Here’s a diagram of how these services are chained together to trigger an event that notifies me via an email when a new NoSQL table is being created.

Wait! There Are More!
This simple use case barely scratches the surface of the potential that the integration of these services will unlock. Let’s briefly explore a few more use cases that can easily be configured.
In the Events service’s Rule Conditions screen below, each “Event Type” monitors a specific resource change in the NoSQL service to trigger an event. For example, during a new index creation, Index-Create Begin can trigger an event to notify developers to improve their query statements in the application. Another use case is when a new column is added, Table-Alter Begin can trigger an event that notifies the administrator and developers about a critical change in the table schema.

In the Events service’s Actions section, the “Action Type” can be configured to invoke Streaming, Notifications, or Functions services. For example, a new NoSQL table creation can trigger an event to invoke the Functions service to create a new object storage container for backup. Another user case is when a NOSQL table is dropped, it can trigger an event to invoke the Streaming service to publish an event message to a stream. The consumers of such messages can initiate some data lifecycle management operations.

Lastly, in the Notifications service’s Configure Subscription screen below, different protocols can be specified for different subscriptions. For example, a subscriber to a topic can be configured to receive notifications through Slack, SMS, Email, or other methods. This offers a host of communication channels for the subscribers to be notified when an event is triggered and take swift actions.

Summary
This blog demonstrates a simple use case of how creating a new NoSQL table can trigger an event that sends an email notification to me. It dives into the integration details that chain these services together to perform this task. It also explores several use cases and integration configurations that can help enterprises meet the challenges faced in today’s competitive business climate.
Go ahead and try other configurations for your business use cases to unlock the potential of the integration between Oracle NoSQL Database, Events, and Notifications services.
