To get started with Redis Enterprise Cloud Essentials, visit https://redislabs.com/try-redis-modules-for-free and fill out the form:
Once you click “Get Started,” we will send you an email with a link to activate your account and complete your signup process.
For the cloud provider, select Amazon AWS
In the Redis Enterprise Cloud service levels, select the Redis Enterprise Cloud Essentials 30MB/1 Database level and click Create:
Once you create a subscription, you are ready to create a database with modules enabled. As shown below, enter a name for the database you want to create:
Move the toggle to select the module you want. You can choose one module at a time under Redis Enterprise Cloud Essentials. Please note that multiple modules capabilities are currently available only in Redis Cloud Pro.
Let’s go ahead and choose “RediSearch” as our first module. Click “Activate”:
The database will remain in “Pending” status until the process of configuring your new Redis database is completed. When the database is created, you will be able to see all the database settings, including:
RedisInsight is an intuitive and efficient GUI for Redis, allowing you to interact with your databases and manage your data—with built-in support for most popular Redis modules. The free non-commercial add-on provides tools to analyze the memory, profile the performance of your database, and guide you toward better Redis usage.
RedisInsight provides built-in support for the RedisJSON, RediSearch, RedisGraph, Redis Streams, and RedisTimeSeries modules to make it even easier to query, visualize, and interactively manipulate search indexes, graphs, streams, and time-series data. Used properly, RedisInsight can make the experience of using modules with Redis Enterprise Cloud Essentials even smoother.
A full-featured desktop GUI client, RedisInsight is available for Windows, macOS, and Linux and is fully compatible with Redis Enterprise. It works with any cloud provider as long as you run it on a host with network access to your cloud-based Redis server. RedisInsight makes it easy to discover cloud databases and configure connection details with a single click. It allows you to automatically add Redis Enterprise Software and Redis Enterprise Cloud databases.
Local installation of RedisInsight:
To use RedisInsight on a local machine, download it for Windows, Mac, or Linux from the RedisInsight page on the RedisLabs website:
Click “Download” to open up a form that allows you to select the operating system of your choice. For example, let’s assume that you want to install RedisInsight on your macOS machine. Choose “Mac OS” as a platform as shown here:
Fill out the rest of the form and click “Download.” Please note that the package name is the combination of the platform and version as shown here:
Click on the RedisInsight executable and install it in your system.
Head over to your web browser and go to http://localhost:8001
You can also run RedisInsight inside Docker containers. Visit https://hub.docker.com/r/redislabs/redisinsight/tags to find the latest Docker image available over DockerHub.
$ docker run -v redisinsight:/db -p 8001:8001 redislabs/redisinsight:latest
Head over to your web browser and go to http://localhost:8001
Congratulations! You have successfully installed RedisInsight and are now ready to inspect your Redis data, monitor database health, and perform runtime server configuration with this browser-based management interface for your Redis deployment.
Once you accept the EULA and click “Confirm,” you are ready to add Redis databases, as shown here:
Select “ADD REDIS DATABASE” and then “Add Database”:
Enter the requested details, including Name, Host (endpoint), Port, and Password in the form, as shown below. You can skip username for now. Then click “ADD REDIS DATABASE”:
Click on the pop-up box to see the RedisInsight dashboard:
Finally, although RedisInsight is a great GUI, sometimes you want to work directly in the command-line interface (CLI). To do so, click “CLI” in the menu on the left side of the RedisInsight UI:
Then paste the appropriate Redis commands in the command section, marked with “>>” as shown below, and press Enter.
You can see the output displayed at the top of the screen. If it says “OK,” the command was executed successfully.
Now that RedisInsight is installed, we’re ready to look at individual Redis modules and see how they work with Redis Enterprise Cloud Essentials.
Using a basic air-quality dataset, we will show you how to:
Let’s create a time series representing air quality dataset measurements. To interact with RedisTimeSeries you will most often use the TS.RANGE command, but here you will create a time series per measurement using the TS.CREATE command. Once created, all the measurements will be sent using TS.ADD.
The sample command below creates a time series and populates it with three entries:
>> TS.CREATE ts:carbon_monoxide >> TS.CREATE ts:relative_humidity >> TS.CREATE ts:temperature RETENTION 60 LABELS sensor_id 2 area_id 32
In the above example, ts:carbon_monoxide, ts:relative_humidity and ts:temperature are key names. We are creating a time series with two labels (sensor_id and area_id are the fields with values 2 and 32 respectively) and a retention window of 60 milliseconds:
Add a new sample data to the time series
Let’s start to add samples into the keys that will be automatically created using this command:
>> TS.ADD ts:carbon_monoxide 1112596200 2.4 >> TS.ADD ts:relative_humidity 1112596200 18.3 >> TS.ADD ts:temperature 1112599800 28.3 >> TS.ADD ts:carbon_monoxide 1112599800 2.1 >> TS.ADD ts:relative_humidity 1112599800 13.5 >> TS.ADD ts:temperature 1112603400 28.5 >> TS.ADD ts:carbon_monoxide 1112603400 2.2 >> TS.ADD ts:relative_humidity 1112603400 13.1 >> TS.ADD ts:temperature 1112607000 28.7
Querying the sample
Now that you have sample data in your time series, you’re ready to ask questions such as:
“How do I get the last sample?”
TS.GET is used to get the last sample. The returned array will contain the last sample timestamp followed by the last sample value, when the time series contains data:
>> TS.GET ts:temperature 1) (integer) 1112607000 2) "28.7"
“How do I get the last sample matching the specific filter?”
TS.MGET is used to get the last samples matching the specific filter:
>> TS.MGET FILTER area_id=32 1) 1) "ts:temperature" 2) (empty list or set) 3) 1) (integer) 1112607000 2) "28.7"
“How do I get the sample with labels matching the specific filter?”
>> TS.MGET WITHLABELS FILTER area_id=32 1) 1) "ts:temperature" 2) 1) 1) "sensor_id" 2) "2" 2) 1) "area_id" 2) "32" 3) 1) (integer) 1112607000 2) "28.7"
Query a range across one or more time series
“How do I get the sample for a time range?”
>> TS.RANGE ts:carbon_monoxide 1112596200 1112603400 1) 1) (integer) 1112596200 2) "2.4" 2) 1) (integer) 1112599800 2) "2.1" 3) 1) (integer) 1112603400 2) "2.2"
You can use various aggregation types such as avg, sum, min, max, range, count, first, last etc. The example below example shows how to use “avg” aggregation type to answer such questions as:
“How do I get the sample for a time range on some aggregation rule?”
>> TS.RANGE ts:carbon_monoxide 1112596200 1112603400 AGGREGATION avg 2 1) 1) (integer) 1112596200 2) "2.4" 2) 1) (integer) 1112599800 2) "2.1" 3) 1) (integer) 1112603400 2) "2.2"
Learn more about RedisTimeSeries in the Quickstart tutorial.