Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roblesdotdev/movies-ms
Working with microservices & golang
https://github.com/roblesdotdev/movies-ms
Last synced: 2 days ago
JSON representation
Working with microservices & golang
- Host: GitHub
- URL: https://github.com/roblesdotdev/movies-ms
- Owner: roblesdotdev
- License: mit
- Created: 2024-02-27T02:24:28.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-28T22:02:04.000Z (11 months ago)
- Last Synced: 2024-11-14T04:36:27.395Z (2 months ago)
- Language: Go
- Size: 57.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Movies Microservices with Go
Application for movie lovers.
## Services
```
+----------------------+
| |
+------------- Movie Service |-------------+
| | | |
| +----------------------+ |
+-------------------+ +-------------------+
| | | |
| Metadata Service | | Rating Service |
| | | |
+-------------------+ +-------------------+```
- **Movie metadata service**: Store and retrieve the movie metadata records by movie IDs.
- **Rating service**: Store ratings for different types of records and retrieve aggregated ratings for records.
- **Movie service**: Provide complete information to the callers about a movie or a set of movies, including the movie metadata and its rating.## Layers
```
+--------------+ +----------------+ +-------------+
--->| API Handler | ---> | Business Logic | ---> | Repository | ---> DB(postgres)
+--------------+ +----------------+ +-------------+
(controller)
```### Consul-based service discovery
Run locally hashicorp consul:
```
docker run -d -p 8500:8500 -p 8600:8600/udp --name=dev-consul hashicorp/consul agent -server -ui -node=server-1 -bootstrap-expect=1 -client=0.0.0.0
```Run each microservice by executing this command inside each cmd directory:
```
go run main.go
```Visit Consul UI via http://localhost:8500.
### Proto VS Json
```
$ make proto
$ go mod tidy
$ make bench
```