Showcases how to use Realtime GraphQL using Redis Streams and real-time search using RediSearch in Java
Prerequisites:
- Java 11
- Maven 3.2+
- Docker
- Redis + Modules 6.0.1 or greater
-
Start the Docker Compose application:
cd redi2hack docker-compose up
-
Run the Spring Boot app to build the application.
./mvnw clean -Dspring-boot.run.profiles=local spring-boot:run
GraphQL is supported using Spring Boot which is backed by Redis enterprise data store.
The data flows from left to right - from GraphQL->Redis and Redis->GraphQL.
-
createCustomer
,updateCustomer
, anddeleteCustomer
GraphQL mutations use Redis hash and stream data to store the state and push the events. -
subscribeEvents
(GraphQL subscription) uses Redis Stream to fetch all customer events or the latest customer events. -
searchCustomers
GraphQL query uses RediSearch to search customers. -
customers
andfindCustomer
use Redis Hash to find the all or a particular customer.
This project shows how to use GraphQL Subscription to push event data from the server using Redis Streams and support real-time search using RediSearch.
- RediStreams: to capture all the customer events
- RediSearch: to support search customer capabilities
- RediHash: to store customer data
- GraphQL:
- Subscription: to push real time customer events
- Mutation: to create/update/delete the customer state
- Query: to query/search customer information
- Goto: redi2hack.herokuapp.com
Note: The app comes with the necessary sample code to follow.
To make deploys work, you need to create free account in https://redislabs.com/try-free/