The project is designed to efficiently process and store 15001 rows of CSV and 817 JSON file into PostgreSQL database utilizing the GORM library. It leverages goroutines for concurrent processing, waitgroups for synchronization, and mutexes to handle race condition, aiming for execution times (< 1 second) to streamline data loading tasks.
- Golang
- Postgres
- Gin Framework
- Gorm DATABASE ORM
-
Clone the repository:
git clone https://github.com/egrizq/product-analysis-with-concurrency.git
-
Copy environment for database:
cp .env.example .env
-
Run the application:
make dev
or alternatively
go run main.go
-
The program will run on http://localhost:8000.
Method | Endpoint | Description |
---|---|---|
POST | localhost:8000/process/insert | Import JSON & CSV file |
POST | localhost:8000/process/reports | Process & analysis |