- Make sure you've installed
docker
anddocker-compose
. - Make sure you've installed
Go
. - Download or clone this
Repo
. Postman Collection
is 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 ensure
to download the dependencies. - Make sure the container for
Database
is running. - On folder
pkg/configs/db/postgres
open filepostgres.go
. - Change
host
fromdatabase_postgres
to `localhost - Change
port
from5432
to5433
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
ads
table will trigger a function to add record todelta_update
. - It will store
ads ID
andaction
with value [add|update|delete]. - A service that running in the background will check on table
delta_update
for every 5 seconds. - It will grab 1000 data and pump to ElasticSearch depend on the action on the row.