- Make sure you've installed
dockeranddocker-compose. - Make sure you've installed
Go. - Download or clone this
Repo. Postman Collectionis in root folder
The source code for the API and service to update ElasticSearch are in folder go/src/.
- Programming Language:
GOLANG - Database:
Postgresql - Full Text Search Engine:
ElasticSearch - Container:
Docker
- Make sure to install
dep. - Run command
dep ensureto download the dependencies. - Make sure the container for
Databaseis running. - On folder
pkg/configs/db/postgresopen filepostgres.go. - Change
hostfromdatabase_postgresto `localhost - Change
portfrom5432to5433
After you download/clone this Repo, go to dockers folder. Run command docker-compose up --build -d
- API nginx:
localhost:81 - Database:
localhost:5433 - ElasticSearch:
localhost:9201
If there are some changes made to the code for API
- Make sure you are in root folder of API (
go/src/API) - Run command
./build.sh - Rebuild the containers by running this command
docker-compose up --build -d
Steps:
- INSERT/UPDATE/DELETE on
adstable will trigger a function to add record todelta_update. - It will store
ads IDandactionwith value [add|update|delete]. - A service that running in the background will check on table
delta_updatefor every 5 seconds. - It will grab 1000 data and pump to ElasticSearch depend on the action on the row.