
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:
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
19 | |
19 | |
15 | |
9 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 |