Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pthethanh/cqrs-example
CQRS example with Go, MySQL, NATS, ElasticSearch
https://github.com/pthethanh/cqrs-example
cqrs elasticsearch golang kubernetes mysql nats
Last synced: about 1 month ago
JSON representation
CQRS example with Go, MySQL, NATS, ElasticSearch
- Host: GitHub
- URL: https://github.com/pthethanh/cqrs-example
- Owner: pthethanh
- License: mit
- Created: 2018-06-01T15:58:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-01T16:06:12.000Z (over 6 years ago)
- Last Synced: 2024-10-09T09:25:32.335Z (about 1 month ago)
- Topics: cqrs, elasticsearch, golang, kubernetes, mysql, nats
- Language: Go
- Size: 10.7 KB
- Stars: 10
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cqrs-example
CQRS example with Go, MySQL, NATS, ElasticSearch, Kubernetes## Deployment
Please make sure you installed Docker, Kubernetes before running below commands:
```sh
# Deploy infra services
cd k8s/
kubectl create -f mysql.yaml
kubectl create -f elasticsearch.yaml
kubectl create -f nats.yaml# Deploy our services
cd ../books
make first_deploy
cd ../book-query
make first_deploy# Post a book, this should result in data to be stored in MySQL and trigger book-query service to store data into ElasticSearch as well
curl --header "Content-Type: application/json" --request POST --data '{"name":"The Outliers"}' http://192.168.99.100:30305/api/v1/books# Query the data, this should go into MySQL
curl http://192.168.99.100:30306/api/v1/books
# Search for the data, this should go into ElasticSearch
curl http://192.168.99.100:30306/api/v1/books/search?query="outliers"```