DEV Community

Juan Sedano
Juan Sedano

Posted on

Removies

Overview of My Submission

This is an API made with Spring Web, uses springdoc-openapi-ui to expose a swagger-ui on https://localhost:8080/swagger-ui/index.html

Using datasets from kaggle we load up Redis with movies and TV show information and then it provides endpoints to query the database.

jedis is used to interact with Redis.

Submission Category:

Wacky Wildcards

Language Used

Java/Spring

Link to Code

Removies

Removies is an api that lets you search movies and tv shows information from a database of movies from several streaming services.

Screen Shot 2022-08-29 at 1 02 21

How it works

How the data is stored:

The data is stored as JSON documents using RedisJSON

public void insert(String key, MediaDTO mediaDTO) {
  jedisPooled.jsonSet(key, gson.toJson(mediaDTO))
}
Enter fullscreen mode Exit fullscreen mode

MediaDTO is the object to be inserted but first it needs to be represented as JSON so we use gson for that.

How the data is accessed:

To access data several indexes need to be created Then RediSearch is used to make queries.

jedisPooled.ftSearch(
    "titleIdx", new Query("@title:(" + cleanTitle + ")").returnFields("title"));
}
Enter fullscreen mode Exit fullscreen mode

How to run it locally?

Prerequisites

  • Have an instance of redis-stack running.
  • Apache Maven 3.8.6
  • Java 17

Local installation

  • Download the following…

Additional Resources / Info

For reading the datasets opencsv is used.
More libraries used:

Datasets used:

You can find the code and how to run it on https://github.com/jsedano/removies.

Top comments (0)