How hsdiqi/komparasi_rust-vs-go works
The repository compares two PostgreSQL-backed product CRUD APIs—Gin in Go and Actix Web in Rust—and includes a performance-benchmarking area. The principal workflow is an HTTP product request routed through a handler and service to repository queries, then returned as a response. The sampled source establishes each API’s CRUD, search, pagination, and health-check paths. Benchmark details and some Go subsystem internals are not sampled, so their wiring is shown only where supported by the README and tree.
Main entry points: main.rs Rust server · route.go HTTP routes · route/mod.rs HTTP routes · service/mod.rs Product service
Components 19
Go Gin API
- Go server
backend-golang-gin/cmd/server/main.go - Configuration
backend-golang-gin/config - HTTP routes
backend-golang-gin/route/route.go - Product handler
backend-golang-gin/handler/product_handler.go - Product service
backend-golang-gin/service/product_service.go - Product repository
backend-golang-gin/repository/product_repository.go - API models
backend-golang-gin/model/product.go
Rust Actix API
- Rust server
backend-rust-actix/src/main.rs - Configuration
backend-rust-actix/src/config/mod.rs - Pool setup
backend-rust-actix/src/db/mod.rs - HTTP routes
backend-rust-actix/src/route/mod.rs - Product handler
backend-rust-actix/src/handler/mod.rs - Product service
backend-rust-actix/src/service/mod.rs - Product repository
backend-rust-actix/src/repository/mod.rs - API models
backend-rust-actix/src/model/mod.rs
Shared data store
- PostgreSQL
Performance research
- Benchmark runner
benchmark/k6-read.js - Benchmark setup
benchmark/README.md
Other components
- API client
Connections 18
- API client → HTTP routes: sends requests
- API client → HTTP routes: sends requests
- Go server → Configuration: loads settings
- Go server → HTTP routes: registers routes
- HTTP routes → Product handler: dispatches
- Product handler → Product service: calls
- Product service → Product repository: calls
- Product repository → PostgreSQL: queries
- Rust server → Configuration: loads settings
- Rust server → Pool setup: creates pool
- Rust server → Product repository: creates repository
- Rust server → Product service: creates service
- Rust server → HTTP routes: configures routes
- HTTP routes → Product handler: dispatches
- Product handler → Product service: calls
- Product service → Product repository: calls
- Product repository → PostgreSQL: queries
- Benchmark setup → Benchmark runner: documents