- Option 1:
docker-compose up
- Option 2: Follow the
Makefile
and start the services usingmake [service-name]
. (Please make sure dynamodb and rabbitmq are running)
The purpose of this project is to develop a highly scalable product using microservice architecture, event-driven development, and DynamoDB.
Create a movie book, where an admin can create movies with associated actors, and users can view movie details and submit their reviews. Since this is a read-heavy application, we need to design with scalability in mind.
- Please create an issue/follow the exiting issues.
- Create a PR containing, change description, unit and integration tests.
- Add actors
- Add/Update/Delete users
- Add movies
- Add review
- Get all movies
- Search movies by name
- Search by genre
- List top rated movies
- List actor details with movies [Feel free to create a PR]
- List user details with reviews [Feel free to create a PR]
- Submit review
- Delete review [Feel free to create a PR]
- Golang
- Web API
- gRPC
- RabbitMQ
- Dynamodb
- Unit tests (Feel free to contribute)
- Integration tests (Feel free to contribute)
- E2E tests (Feel free to contribute)
- Manual testing
Looks scary? Let's break down the user actions:
User and actor creation are mostly straight forward, it store the data into their own table.
Movie creation is connected to several other features, such as listing movies by genre and listing movies by a particular actor. To make these operations scalable, we will pre-populate the necessary data for genres and actor details. After storing the data in the table, it triggers an event that is processed by actor and movie event listeners to generate the appropriate data for their respective services.
Reviews are linked to both movies and users. When a review is added, it triggers an event that is processed by both the movie event listener and the user event listener. The movie event listener updates the overall score of the movie and recalculates the top-reviewed movies. The user event listener updates the user details page, allowing the user to view the reviews they have submitted.
To improve scalability, we have duplicated user data in the movie table when a review is submitted. As a result, if a user updates their name, we also need to update the corresponding data in the movie table. To achieve this, another event is triggered after the user's name is updated, and the review event listener updates the user name accordingly.