The Wolfram Language makes it easy to store things either in the Wolfram Cloud, or locally on your computer system. Let’s talk about the Wolfram Cloud first.

In the Wolfram Cloud everything is a cloud object, specified by a UUID (universally unique identifier).

CloudObject[ ]

As soon as you create a cloud object, it’s assigned a long randomly generated UUID. The great thing about UUIDs is that one can assume that there’ll never be two of the same generated. (There are 300 trillion trillion trillion possible Wolfram UUIDs.)

CloudPut[{,}]

CloudGet[%]

If you’ve made definitions using = and :=, you can save these using CloudSave. (If your definitions depend on other definitions, these will get saved too.) You can load your definitions into a new session using CloudGet.

colorlist[n_Integer]:=RandomColor[n]

CloudSave[colorlist]

CloudPut lets you store single Wolfram Language expressions. But what if you want to progressively accumulate expressions—coming either from within the Wolfram Language, or, say, from an outside device or sensor?

The Wolfram Data Drop lets you do exactly this. You start by creating a databin. You can do this in the Wolfram Language using CreateDatabin.

bin=CreateDatabin[ ]

You can add data to this databin from all sorts of outside devices and services—as well as using the DatabinAdd function in the Wolfram Language.

DatabinAdd[bin,{1,2,3,4}]

DatabinAdd[bin,{a,b,c}]

Values[bin]

Here’s a databin that’s accumulated data from a little sensor on my desk. DateListPlot plots the time series of data.

Databin["7m3ujLVf"]

DateListPlot[Databin["7m3ujLVf"]]

Wolfram Data Drop, like CloudPut and CloudSave, saves data into the cloud. But particularly if you’re not connected to the cloud, you may instead want to store things on a local computer. If you figure out where in your filesystem you want the files to go, you can use Put, Save and Get to store and retrieve them.

It’s also possible to get the Wolfram Language to automatically figure out an “anonymous” local location. You can do this with LocalObject.

LocalObject[ ]

Put[,%]

Get[%]

What do the letters and numbers in UUIDs mean?

They’re digits in hexadecimal (base 16); the letters “a” through “f” are the hex digits 10 through 15. Each UUID has 32 hex digits, corresponding to 16^32≈3×(10^38) possibilities.

How does the number of possible UUIDs compare to other things?

It’s about the number of atoms in a cubic kilometer of water, or 100 trillion times the number of stars in the universe. If every one of 50 billion computers on Earth generated a UUID at 10 GHz, it’d take the age of the universe to run out of UUIDs.

How do UUIDs relate to short IDs?

All short IDs as generated by URLShorten are explicitly registered, and guaranteed to be unique, a bit like domain names on the internet. UUIDs are long enough that they can be assumed to be unique, even without any kind of central registration.

Can I specify a file name in CloudObject, CloudPut, etc.?

Yes. And the file name will be taken to be relative to your home directory in the cloud. The file will also get a URL, that includes the base of the cloud you’re using, and your user ID.

Can other people access what I store in a cloud object?

Not usually. But if you set the option Permissions->"Public" then everyone can access it, just like we discussed for web apps in Section 36. You can also define exactly who you want to allow to do what with it.

Can I work with databins without using the Wolfram Language?

Yes. You can use the web and many other systems to create and add to databins.

Is there a way to manipulate an expression in the cloud, without getting the whole expression?

Yes. Make it a cloud expression (using CreateCloudExpression). Then all the usual ways of getting and setting parts of the expression will work, but the expression will be persistently stored in the cloud.

Tech Notes