Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
antoniojmnunes
Product and Topic Expert
Product and Topic Expert
1,343

In the below blog post we are going to learn how to populate a dataset to Redis instance using redis-cli data import, for testing purposes.

Access and download data samples ready to use as Redis datasets from https://github.com/Redis-Developer/redis-datasets/tree/movie-dataset/movie-database 

Follow the below steps:

1️⃣ Download a data sample

In our example, we are going to import 2 datasets, previous downloaded to a local folder from the above source url. The 2 datasets are the below:

Redis_4_1.png

2️⃣  Import the datasets 

For importing the datasets, we will use redis-cli below commands:

redis-cli --tls -c -p 6666 -a <password> < ./Downloads/redis_sample/import_movies.redis
redis-cli --tls -c -p 6666 -a <password> < ./Downloads/redis_sample/import_actors.redis

Note: To learn on how to connect from your local pc to the Redis instance, using a SSH connection,  please read this blog.

👉  Important: it’s mandatory the use of TLS for security reasons, we need run the import commands with the --tls connection parameter.

⚠️  Attention: Redis on SAP BTP service is a cache service and SAP is not providing the service with data persistence capabilities.

3️⃣  Query the dataset using ‘redis-cli’ commands

Connect to the Redis instance (via --tls using ssh port) and run GET command to query the upload data.

redis-cli --tls -c -p 6666 -a <password

By querying (GET) the loaded dataset, you can retrieve information about the movies and actors, based on the previous imported datasets, as shown below.

Redis_4_2.png

If you want to learn more about the service check also:

Please refer always to the product official documentation at SAP Help Portal.

Thanks for your reading,

SAP BTP Backing Services – Product Management