Storage Nodes

16 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€65.14
List Price:  €93.07
You save:  €27.92
£55.73
List Price:  £79.62
You save:  £23.88
CA$95.61
List Price:  CA$136.60
You save:  CA$40.98
A$106.30
List Price:  A$151.87
You save:  A$45.56
S$94.64
List Price:  S$135.20
You save:  S$40.56
HK$546.91
List Price:  HK$781.33
You save:  HK$234.42
CHF 63.50
List Price:  CHF 90.72
You save:  CHF 27.21
NOK kr764.69
List Price:  NOK kr1,092.46
You save:  NOK kr327.77
DKK kr485.92
List Price:  DKK kr694.20
You save:  DKK kr208.28
NZ$117
List Price:  NZ$167.15
You save:  NZ$50.15
د.إ257.06
List Price:  د.إ367.25
You save:  د.إ110.18
৳7,661.98
List Price:  ৳10,946.16
You save:  ৳3,284.17
₹5,839.65
List Price:  ₹8,342.71
You save:  ₹2,503.06
RM331.75
List Price:  RM473.95
You save:  RM142.20
₦86,437.65
List Price:  ₦123,487.65
You save:  ₦37,050
₨19,492.21
List Price:  ₨27,847.21
You save:  ₨8,355
฿2,575.56
List Price:  ฿3,679.53
You save:  ฿1,103.97
₺2,262.43
List Price:  ₺3,232.18
You save:  ₺969.75
B$357.76
List Price:  B$511.10
You save:  B$153.34
R1,296.01
List Price:  R1,851.52
You save:  R555.51
Лв127.38
List Price:  Лв181.98
You save:  Лв54.60
₩95,113.23
List Price:  ₩135,881.87
You save:  ₩40,768.63
₪260.11
List Price:  ₪371.60
You save:  ₪111.49
₱3,999.61
List Price:  ₱5,713.97
You save:  ₱1,714.36
¥10,715.43
List Price:  ¥15,308.41
You save:  ¥4,592.98
MX$1,185.45
List Price:  MX$1,693.57
You save:  MX$508.12
QR254.79
List Price:  QR364.01
You save:  QR109.21
P955.69
List Price:  P1,365.33
You save:  P409.64
KSh9,427.65
List Price:  KSh13,468.65
You save:  KSh4,041
E£3,355.67
List Price:  E£4,794.02
You save:  E£1,438.35
ብር3,989.43
List Price:  ብር5,699.43
You save:  ብር1,710
Kz58,616.62
List Price:  Kz83,741.62
You save:  Kz25,125
CLP$66,326.02
List Price:  CLP$94,755.52
You save:  CLP$28,429.50
CN¥506.51
List Price:  CN¥723.62
You save:  CN¥217.11
RD$4,049.59
List Price:  RD$5,785.38
You save:  RD$1,735.78
DA9,420.19
List Price:  DA13,457.99
You save:  DA4,037.80
FJ$157.70
List Price:  FJ$225.30
You save:  FJ$67.59
Q542.62
List Price:  Q775.21
You save:  Q232.58
GY$14,613.08
List Price:  GY$20,876.73
You save:  GY$6,263.64
ISK kr9,792.30
List Price:  ISK kr13,989.60
You save:  ISK kr4,197.30
DH706.05
List Price:  DH1,008.69
You save:  DH302.63
L1,239.86
List Price:  L1,771.31
You save:  L531.44
ден4,010.92
List Price:  ден5,730.13
You save:  ден1,719.21
MOP$562.15
List Price:  MOP$803.11
You save:  MOP$240.95
N$1,302.54
List Price:  N$1,860.85
You save:  N$558.31
C$2,571.43
List Price:  C$3,673.63
You save:  C$1,102.20
रु9,317.58
List Price:  रु13,311.40
You save:  रु3,993.82
S/262.81
List Price:  S/375.46
You save:  S/112.65
K268.53
List Price:  K383.63
You save:  K115.10
SAR262.51
List Price:  SAR375.03
You save:  SAR112.52
ZK1,879.71
List Price:  ZK2,685.42
You save:  ZK805.70
L324.19
List Price:  L463.14
You save:  L138.95
Kč1,629.65
List Price:  Kč2,328.17
You save:  Kč698.52
Ft25,373.17
List Price:  Ft36,248.95
You save:  Ft10,875.77
SEK kr758.75
List Price:  SEK kr1,083.98
You save:  SEK kr325.22
ARS$61,468.94
List Price:  ARS$87,816.53
You save:  ARS$26,347.59
Bs482.36
List Price:  Bs689.12
You save:  Bs206.75
COP$272,946.91
List Price:  COP$389,940.87
You save:  COP$116,993.96
₡35,623.88
List Price:  ₡50,893.45
You save:  ₡15,269.56
L1,732.95
List Price:  L2,475.75
You save:  L742.80
₲523,151.84
List Price:  ₲747,391.81
You save:  ₲224,239.96
$U2,683.09
List Price:  $U3,833.15
You save:  $U1,150.06
zł281.85
List Price:  zł402.67
You save:  zł120.81
Already have an account? Log In

Transcript

Video 3.7 storage nodes. In this video, we'll learn how to use storage nodes from your pallet. So why do you need storage nodes? But first, what are storage nodes? These are nodes which help you store your data in your database. And why would you need that?

It's because you don't want to lose your data within no trade. You fear what happens if node red crashes one day? What happens if all my data is gone? That is why we have the storage nodes in Node red. These nodes help you in connecting with databases and storing your data looks elementary and it is actually foolproof, trust me. In this video, I will be briefing you on three essential storage nodes Cloudant Sq light and Cloud object storage I'll explain what each of them means and how to use them.

Okay, I'm sure you have a question for me, is it? Can I only use these three nodes? Doesn't know don't have any other databases linked to it? Of course it does. If you want to know what else is there, you need to check it in the Manage palette. You can see my SQL MongoDB.

Oracle, get it. It has both SQL and no SQL databases. So not to worry. The three nodes that I teach you are different from each other. And that way, I think you learn to use any database note there is the first of the more or less Cloudant cloud and cloud. Yes, it is a cloud based database service offered by IBM.

And we're going to start with that because it's in the cloud. is a no SQL database, which means the structure needn't be predefined. It stores data as JSON documents. If you want to know more, now would be the right time to pause this video to check out the link in the resources and learn what it is. Like I told you before, it is a service offered by IBM. And if you've noticed, there is already a service instance of Cloudant running on your org.

Now let's check out the service. Click on launch Cloudant database to launch it. Here, you can see that there is already a database created called note read. This one has all of your node read flows, so don't even think about deleting it for fun. Now, let me show you how to create a new database. See, that's all it takes for you to create a new database.

Now let's add some data into it via no dread We need the Cloudant out node to store our data. Whenever you start using a new node, go through the node help doc to get started with it. We can inject some data into this using the inject node. So let's connect that. First, let's configure the inject node. Now remember, Cloudant collects Jason.

So let's send JSON data, let's say state hungry. Now let's configure the cloud in Node. As you can see, the service is automatically detected because the database is in the same services, no dread. You just have to mention the database you need to connect with and in my case, it is la kr dashDB. Note that you should not use no dread because it would be hazardous. We have two options here to insert and to remove In both cases, we can pass the whole object or the message dot payload property alone.

I'm going to send only my message dot payload property, you can try sending the whole message object also deploy and inject. I'm going to inject three times. No errors. Let's see, refresh. And there you see it. three entries.

The payload went from the inject node. The other two, underscore ID and underscore rave are created by the Cloudant itself. You need to pass these in the message object to update and delete the data associated with underscore ID and underscore rave. What happens if we inject on the same ID? Let's check that we can copy this ID and use it in the injection See, it throws an error, fail to insert document, couch returned four or nine, which means conflict. This is because the underscore Id already exists.

So how do I update this document. For that, you need the other cloud into node we saw before, which will return the data you searched for. So first, we'll search for the ID. So we will configure this node accordingly. Since we have to search the ID, we have to pass that alone as a parameter. So let's remove the state parameter.

Then we can change the message dot payload dot state, to whatever I'm feeling now, or you're feeling now using the change node. Just stuffed myself with bunnies. It's cottage cheese. So I'm feeling satiated. I'm going to update the same. Let's see.

There you go. Now let's try deleting the same ID because that is what is left. We need to select Remove instead of insert. We don't need any other nodes. deploy the app and inject error. This is you need underscore ID and underscore riff To delete a document.

Okay, let's add the underscore ref to let's check out what has happened. terminated. Good see within minutes you learned how to create, update and delete documents in Cloudant. One important thing to note is the Cloudant database page can sometimes ask for authentication without even you setting any credentials. In that case, you have to create new service credentials from the service page and use it here. We'll see how to create one soon in this video.

Next, we can look into Cloud object storage, which is also a service offered by IBM cloud. So why should we go for Cloud object storage? Wait, what is Cloud object storage in the first place? Cloud object storage, like the name says, is an object storage and not a database. So what's the difference? Well, for that you want to know what an object is.

In this sense. Objects are nothing but large sets of unstructured data like music, videos, documents, and pictures. And in this case, we store these objects in the cloud. So when do you go for object storage? When you want your content to be always available, an impatient user like me, will want to access my data very quickly. When you want to access your data content from anywhere, and from any device, every object has three things, the data itself, its metadata, and a globally unique identifier.

The data, like I told you before, can be anything like books, photos, videos, music files, etc. The metadata tells about what the data is, what it should be used for, its confidentiality, and more. This can be customized because of which it helps in faster data retrieval. The globally unique identifier helps To retrieve our data from a globally distributed system, a typical example would be valet parking. When you go to an airport and you give your car keys to the valley, and he gives you a ticket, which is a unique identifier in return, he can park your car anywhere you need not know about it. Once you return, you can show the unique identifier and get your car back.

Another feature of the object store is that it supports cross regional storage of your data. So if your data is stored in America, and then you move to Europe, it will be slow for you to read it. So in an object store, there are multiple copies of your data pushed in different regions, which is a configuration option and it comes with a price. Another thing to note is that you can archive large data sets at low costs cheaper than the traditional databases. To know more about this, find the appropriate link in the resources and go through it. Like I told you before, CLS is a service present in the IBM Cloud, so we have to install it into your application.

Let's do that first. After adding it, we have to create a bucket. You need to give a unique name here. You can choose your region and resiliency and click Create. There you go. Now we have to get some service credentials.

To use it in Node red. Click on New credentials, since we don't have one already. You can change the name leave the rest of the options as it is and click Add. Make sure you have writer access. Okay, that is all you have to do here. Now go to no dread.

You can notice That SEO S is not installed by default. So you have to install them separately using the Manage palette. After it has been installed, you can find them in the palette. You can find four of them, get, put, delete, and query. These are all self explanatory. We will use the put node to save some audio files and some pictures.

For this, we need to install a set of nodes from browser utils. We have installed a camera node and a microphone node. From these you can see that the camera generates an image file and the microphone generates an audio file. Okay, now let's add these and configure the CEOs put node. Remember I had put a p cross region and you can get the API key from the service credentials you have created. You can get the service credential From here, add a name and click Done.

Here, you have to add your bucket name, you must set the mode as message dot payload. Because the image is sent in payload property by the camera, and the camera node produces a file. png. So set it up here. Don't forget to add the object name with an extension. That's it.

I have added debug node on the other side just to see what it is returning. Deploy and check. When you click on the camera button, it triggers your laptop camera, which will ask for permission. Now it's taking a picture of me. Super, the images sent as arrays of bytes in the message dot payload. Now we can go and check the bucket.

You have to download the file to view it. That's me. Okay. I want you to try the microphone output. Just like we did the camera node by yourself. I have added a flow in the resources for you to try out the other CEOs nodes.

The next is Sq light nodes. sq light is a small lightweight sequel based database. It is a popular choice as an embedded database for local storage in application software. To know more, check out for a link in the resources. We can test these nodes in our pie because it is easy to install SQL lite in the pie and use. The nodes again are not installed by default.

So you have to install it from the menu. ballot will install SQL lite on RPI. I have attached a file, which contains all the commands you need to run on your PI. To install SQL lite along with the explanation of why you should run them. Use them to install. After installing, come to node red and configure the Sq like node.

Give some name here and make sure you select message topic. I have added a flow file which contains four inject nodes with SQL queries as its topics because that is how we're going to send them add a debug node at the other end of the Sq light node to see what happens when you inject the flow. I have included Link in the resources, which will help you start off with SQL queries. If you haven't used it before. I have also included a link in the resources section. If you want to learn SQL queries, connect all the four inject nodes to the SQL lite node and deploy the flow.

Now try injecting one by one from the inject node and see what happens. During this inject, you can see that it shows the output of the Select query. When you delete, everything will be gone. You can cross check what's happening from the RPI too. So that's it for this video. In this video, you've learned the different types of storage nodes we can use with node red.

In the next video, I will introduce you to a special class of nodes, called the dashboard nodes.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.