Skip to content

Commit dba3967

Browse files
authored
QA + Improvements to examples-nosql-cluster-deployment + support for demo at ENBW (#128)
* QA - updating versions and correcting some bug found * draft version for demo-event ENBW * QA + adding primary-secondary-rf3 support * Quick fix arbiters * missing admin in secondary * Update single-node-rf1.kvs * Update primary-secondary-cap1.jpg * improving pri/sec * Update scenario-9.md * Modifying script maintenance * Update scenario-9.md
1 parent 29e936f commit dba3967

File tree

111 files changed

+1282
-109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1282
-109
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Baggage Tracking Demo
2+
3+
## Introduction
4+
5+
This lab walks you through a live baggage tracking demo that was created by the Oracle NoSQL development team.
6+
7+
Estimated Time: 7 minutes
8+
9+
10+
### Serverless Logic Tier
11+
12+
We selected this demo because it solves real world business problems. Many of those are listed on the slide.
13+
14+
![](images/business-problem.png)
15+
16+
This application is running in all the OCI regions.
17+
18+
![](images/demo-region.png)
19+
20+
The application behind the demo uses a three-tier architecture, representing the brains of the application. Integrating these components: an API Gateway, Streams, and Functions; in your logic tier can be revolutionary. The features of these services allow you to build a serverless production application that is highly available, scalable, and secure. Your application can use thousands of servers, however, by leveraging this pattern you do not have to manage a single one.
21+
22+
In addition, by using these managed services together you gain the following benefits:
23+
* No operating systems to choose, secure, patch, or manage.
24+
* No servers to size, monitor, or scale out.
25+
* No risk to your cost by over-provisioning.
26+
* No risk to your performance by under-provisioning.
27+
28+
Here is a diagram of architecture behind the demo.
29+
30+
![](images/arch-diagram.png)
31+
32+
Here is an architecture diagram at the component level.
33+
34+
![](images/component-arch.png)
35+
36+
37+
### Objectives
38+
39+
* Explore the baggage tracking demo
40+
41+
### Prerequisites
42+
43+
* Connection to the internet
44+
* Personal cellphone
45+
46+
47+
## Task 1: The "Traveling User" Problem!
48+
49+
This particular application came to the NoSQL team from Emirates airlines. When we thought about this for a little bit, we realized that this was a perfect use case for NoSQL. Many airlines, like United, Delta, American are now offering real time baggage tracking. You have to install their application, and you get close to a real time feed of where your bag is at as it moves along its journey. This is a really good example of companies offloading queries from the operational data store. In the Emirates case, this data was already collected in their operational database and they didn’t want to put consumer level queries on that data store. The second thing in this example is the involvement of an active/active configuration. You write data locally in closest data center as that bag travels, but you want to read it from anywhere. For the best latency, you want the RFID bag scans to be immediately written to the local data center and then let the system take care of propagating that data to the other data centers in an active/active set up. If you took a trip from the US to Europe for example, the last thing you would want to do is force all the writes back to the US. Hundreds of bags get scanned per flight segment and you need the best possible latency.
50+
51+
What are some of the goals of this application:
52+
53+
- Predictable low latency
54+
- Scalable to your user base
55+
- Highly available
56+
- Auto-expiry of the data - baggage location data has a limited lifespan
57+
- Offload consumer queries from operation data store
58+
59+
60+
## Task 2: Grab your Personal Cell Phone
61+
62+
1. In a browser window, enter ndcsdemo.com
63+
64+
![](images/ndcs-google.png)
65+
66+
This brings you to the welcome screen for Blue Mist airways.
67+
68+
![](images/blue-mist.png)
69+
70+
## Task 3: Track a Bag
71+
72+
1. Tap on the 'Track Your Baggage' button.
73+
74+
![](images/blue-mist-track.png)
75+
76+
After doing so, you will get random baggage information for a traveler. Scroll through the information. In an application from a real airlines, a variety of different information can be displayed.
77+
78+
![](images/ferry-trip.png)
79+
80+
## Task 3: Select New Traveler
81+
82+
1. Tap on the 'hamburger' button on the top right, and then hit ‘Track Your Baggage’ again. A new random traveler will be shown.
83+
84+
![](images/hamburger-menu.png)
85+
86+
![](images/track-bag.png)
87+
88+
## Task 4: Explore the JSON data record
89+
90+
1. The data record is a JSON document with several nested arrays. Oracle NoSQL makes it easy to handle nested arrays.
91+
92+
![](images/json-record.png)
93+
94+
95+
## Task 5: Key takeaways
96+
97+
1. While this was a simple demo, it used many components that are available in OCI today.
98+
99+
* Application is running live in all OCI Regions
100+
* Application uses OCI traffic Management for Geo-Steering to steer network requests to closest OCI region
101+
* OCI API gateway is used
102+
* UI development done with Visual Builder Cloud Service
103+
* Tomcat Server for REST calls
104+
* Data stored in Oracle NoSQL Cloud Service as JSON documents
105+
106+
107+
2. The benefits to customers are shown in this slide.
108+
109+
![](images/benefits.png)
110+
111+
You may now **proceed to the next lab.**
112+
113+
## Learn More
114+
115+
* [About Architecting Microservices-based applications](https://docs.oracle.com/en/solutions/learn-architect-microservice/index.html)
116+
* [Speed Matters! Why Choosing the Right Database is Critical for Best Customer Experience?](https://blogs.oracle.com/nosql/post/speed-matters-why-choosing-the-right-database-is-critical-for-best-customer-experience)
117+
* [Oracle NoSQL Database Multi-Region](https://blogs.oracle.com/nosql/post/oracle-nosql-database-multi-region-table-part1)
118+
* [About Security, Identity, and Compliance](https://www.oracle.com/security/)
119+
* [Application Development](https://www.oracle.com/application-development/)
120+
121+
### Services
122+
123+
* [Oracle NoSQL Database Cloud Service page](https://www.oracle.com/database/nosql-cloud.html)
124+
* [About API Gateway](https://docs.oracle.com/en-us/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm)
125+
* [About Streaming](https://docs.oracle.com/en-us/iaas/Content/Streaming/Concepts/streamingoverview.htm)
126+
* [About Connector Hub](https://docs.oracle.com/en-us/iaas/Content/service-connector-hub/overview.htm)
127+
* [About Functions](https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm)
128+
129+
130+
131+
## Acknowledgements
132+
* **Author** - Dario Vega, Product Manager, NoSQL Product Management and Michael Brey, Director, NoSQL Product Development
133+
* **Last Updated By/Date** - Michael Brey, Director, NoSQL Product Development, September 2021
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
# Create Tables and Load Tables
2+
3+
## Introduction
4+
5+
This lab walks you through creating and loading NoSQL tables. This can be done a variety of different ways including using the OCI console, writing an application program, or triggering actions via a function. This lab will walk you through a couple of different approaches. Oracle NoSQL Database Cloud Service supports both schema-based and schema-less (JSON) modeling so we will create examples of both tables.
6+
7+
Estimated Time: 25 minutes
8+
9+
### Objectives
10+
11+
* Create 3 tables with provisioned reads/sec, writes/sec, and GB storage
12+
* Write data to the table and read data from the table
13+
* Look at the data in the tables via the OCI console
14+
15+
### Prerequisites
16+
17+
* An Oracle Free Tier, Always Free, or Paid Cloud Account
18+
* Connection to the Oracle NoSQL Database Cloud Service
19+
* Working knowledge of bash shell
20+
21+
## Task 1: Create an Oracle NoSQL Table With the Console
22+
23+
1. On the OCI menu drop down on the left, go to Databases and then hit 'Tables' under Oracle NoSQL Database. This brings you to the 'Table' screen where you can create a table from the console.
24+
25+
![](./images/nosql-tables.png)
26+
27+
2. Click on 'Create Table' and the 'Create Table' screen appears.
28+
29+
![](./images/create-tables.png)
30+
31+
This screen allows you to create tables in one of two different ways, either using simple input or using DDL input. For this Lab we are going to use the simple input method.
32+
33+
3. The first thing you want to do is click the 'Always Free Configuration' toggle button. This will create an always free table. Each tenancy is allowed 3 always free tables. Always free tables have fixed provisioning at 50 read units, 50 write units and 25 GB of storage. We have mentioned several times in this workshop that you want to be in the Phoenix region. NoSQL always free tables are only available in the Phoenix region and you need to be in the correct region to use them.
34+
35+
![](./images/always-free.png)
36+
37+
Clicking on the 'Always Free Configuration' button grays out the boxes to input provisioning. Next enter a name for your table, a primary key and column. For this example, we used freeTest as the name, pkey with a type of integer as the primary key, and name with a type string as an additional column. Click 'Set as a Shard Key'.
38+
39+
4. When done with inputs click on 'Create Table' at the bottom.
40+
41+
![](./images/create-myfree-table.png)
42+
43+
In summary, this screen allows to create a table with multiple columns for the primary key, as well as adding multiple additional columns. You can easily create simple or more complex tables with this interface.
44+
45+
5. After clicking on 'Create Table' you will be brought to the Tables screen. This screen shows you a list of tables you have created, as well as basic information about the table. One important thing to notice is that our table has a status of 'Active' which means we are ready to load data into our table. Another thing to notice is the 'Always free' tag that is attached to the table. This lets you know it is an always free table.
46+
47+
![](./images/freetest-table.png)
48+
49+
50+
## Task 2: NoSQL Tables Deployment
51+
52+
In this task we are going to create tables using the Cloud Shell, and OCI CLI interface. The OCI CLI commands issued from the Cloud Shell make REST calls to the Oracle NoSQL Database Cloud Service (NDCS). OCI offers several SDKs in different languages that you can use to make REST calls to NDCS. To make things a little simpler, we have created some shell scripts and files that will assist you in this Task. We need to download those to the Cloud Shell first.
53+
54+
1. Start the Cloud Shell.
55+
56+
![Cloud Shell](https://oracle-livelabs.github.io/common/images/console/cloud-shell.png)
57+
58+
2. Execute the following environment setup shell script in the Cloud Shell. If you close/open the Cloud Shell Console, please re-execute it.
59+
60+
```
61+
<copy>
62+
source ~/serverless-with-nosql-database/env.sh
63+
</copy>
64+
```
65+
66+
3. Let's create NoSQL tables using the OCI CLI. The CLI command for Oracle NoSQl is 'oci nosql <command>'. We will create two different tables and echo the DDL statements so you can see what is being created. One of the tables is a fixed schema table and the other is a JSON document table. To create the always free table using the OCI CLI, you specify the --is-auto-reclaimable flag, as shown in the code below.
67+
68+
```
69+
<copy>
70+
cd ~/serverless-with-nosql-database/objects
71+
DDL_TABLE=$(cat demo.nosql)
72+
echo $DDL_TABLE
73+
</copy>
74+
```
75+
76+
```
77+
<copy>
78+
oci nosql table create --compartment-id "$COMP_ID" \
79+
--name demo --ddl-statement "$DDL_TABLE" \
80+
--is-auto-reclaimable false \
81+
--table-limits="{\"maxReadUnits\": 50, \"maxStorageInGBs\": 25, \"maxWriteUnits\": 50 }" \
82+
--wait-for-state SUCCEEDED --wait-for-state FAILED
83+
</copy>
84+
```
85+
```
86+
<copy>
87+
DDL_TABLE=$(cat demoKeyVal.nosql)
88+
echo $DDL_TABLE
89+
</copy>
90+
```
91+
```
92+
<copy>
93+
oci nosql table create --compartment-id "$COMP_ID" \
94+
--name demoKeyVal --ddl-statement "$DDL_TABLE" \
95+
--is-auto-reclaimable false \
96+
--table-limits="{\"maxReadUnits\": 50, \"maxStorageInGBs\": 25, \"maxWriteUnits\": 50 }" \
97+
--wait-for-state SUCCEEDED --wait-for-state FAILED
98+
</copy>
99+
```
100+
101+
4. Minimize the Cloud Shell by clicking on the minimization button.
102+
103+
![](./images/cloud-shell-small.png)
104+
105+
106+
## Task 3: Adding Data From the OCI Console
107+
108+
1. Make sure you are 'Table' screen. You should see 3 tables listed. Your compartment should be demonosql.
109+
110+
![](./images/table-screen.png)
111+
112+
2. Click on demo table
113+
114+
![](./images/capturenosql.png)
115+
116+
3. Click on 'Insert Row'. This opens up a new window. This time, choose Advanced Json Input.
117+
118+
Copy/Paste the json Baggage document in JSON input text box. Because this Json document is complex, it is easiest to copy/paste into the field. However, you could have typed it all in.
119+
120+
````
121+
<copy>
122+
{
123+
"fullName" : "Abram Falls",
124+
"contactPhone" : "921-284-5378",
125+
"ticketNo" : "176233524485",
126+
"confNo" : "HP1D4H",
127+
"gender" : "F",
128+
"bagInfo" : [ {
129+
"id" : "79039899127071",
130+
"tagNum" : "17657806285185",
131+
"routing" : "SYD/SIN/LHR",
132+
"lastActionCode" : "OFFLOAD",
133+
"lastActionDesc" : "OFFLOAD",
134+
"lastSeenStation" : "LHR",
135+
"flightLegs" : [ {
136+
"flightNo" : "BM254",
137+
"flightDate" : "2019.02.28 at 22:00:00 AEDT",
138+
"fltRouteSrc" : "SYD",
139+
"fltRouteDest" : "SIN",
140+
"estimatedArrival" : "2019.03.01 at 03:00:00 SGT",
141+
"actions" : [ {
142+
"actionAt" : "SYD",
143+
"actionCode" : "ONLOAD to SIN",
144+
"actionTime" : "2019.02.28 at 22:09:00 AEDT"
145+
}, {
146+
"actionAt" : "SYD",
147+
"actionCode" : "BagTag Scan at SYD",
148+
"actionTime" : "2019.02.28 at 21:51:00 AEDT"
149+
}, {
150+
"actionAt" : "SYD",
151+
"actionCode" : "Checkin at SYD",
152+
"actionTime" : "2019.02.28 at 20:06:00 AEDT"
153+
} ]
154+
}, {
155+
"flightNo" : "BM272",
156+
"flightDate" : "2019.02.28 at 19:09:00 SGT",
157+
"fltRouteSrc" : "SIN",
158+
"fltRouteDest" : "LHR",
159+
"estimatedArrival" : "2019.03.01 at 03:10:00 GMT",
160+
"actions" : [ {
161+
"actionAt" : "LHR",
162+
"actionCode" : "Offload to Carousel at LHR",
163+
"actionTime" : "2019.03.01 at 03:01:00 GMT"
164+
}, {
165+
"actionAt" : "SIN",
166+
"actionCode" : "ONLOAD to LHR",
167+
"actionTime" : "2019.03.01 at 11:20:00 SGT"
168+
}, {
169+
"actionAt" : "SIN",
170+
"actionCode" : "OFFLOAD from SIN",
171+
"actionTime" : "2019.03.01 at 11:10:00 SGT"
172+
} ]
173+
} ],
174+
"lastSeenTimeGmt" : "2019.03.01 at 03:06:00 GMT",
175+
"bagArrivalDate" : "2019.03.01 at 03:06:00 GMT"
176+
} ]
177+
}
178+
</copy>
179+
````
180+
181+
182+
4. Click on 'Insert Row' at bottom left of screen.
183+
184+
You have seen two different ways to insert data into a table.
185+
186+
## Task 4: Show Data From the Console
187+
188+
Starting with the demo table, we can go and look at the data we inserted for each of the tables.
189+
190+
1. On the left Click on Explore Data
191+
192+
![](./images/table-row-select.png)
193+
194+
2. In the textbox Query, keep the text `SELECT * FROM demo`. This will select all the rows from our table. Click on Run query
195+
196+
![](./images/run-query.png)
197+
198+
You will see in the bottom of the screen the row that we inserted.
199+
200+
3. Go to the top left, hit 'Tables', select the freeTest table, and look at the row inserted into that table.
201+
202+
You may now **proceed to the next lab.**
203+
204+
## Learn More
205+
206+
* [Oracle NoSQL Database Cloud Service page](https://www.oracle.com/database/nosql-cloud.html)
207+
* [About Oracle NoSQL Database Cloud Service](https://docs.oracle.com/pls/topic/lookup?ctx=cloud&id=CSNSD-GUID-88373C12-018E-4628-B241-2DFCB7B16DE8)
208+
* [About Cloud Shell](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/cloudshellintro.htm)
209+
210+
211+
## Acknowledgements
212+
* **Author** - Dario Vega, Product Manager, NoSQL Product Management and Michael Brey, Director, NoSQL Product Development
213+
* **Last Updated By/Date** - Michael Brey, Director, NoSQL Product Development, September 2021

0 commit comments

Comments
 (0)