Implementation of Online Round Task Backend | DEV Challenge XIX
- Arangodb - Powerful Graph database with excellent Performance
- Golang - high performance language for make API-layer between client and database with minimal delay
- Gin Web Framework - help build API fast: router, request validation, building response.
- Postman - Useful tool which provide UI for create API tests and next export tests as JSON to run inside docker runner
docker compose up -d
curl -i -X POST http://127.0.0.1:8080/api/people
Note: Port 8080, protocol http. no sense in ssl on local, also by common rule port 8080 is http (I assume if we need ssl specs should include for port 8443)
docker compose run postman
Example results:
┌─────────────────────────┬─────────────────┬─────────────────┐
│ │ executed │ failed │
├─────────────────────────┼─────────────────┼─────────────────┤
│ iterations │ 2 │ 0 │
├─────────────────────────┼─────────────────┼─────────────────┤
│ requests │ 280 │ 0 │
├─────────────────────────┼─────────────────┼─────────────────┤
│ test-scripts │ 560 │ 0 │
├─────────────────────────┼─────────────────┼─────────────────┤
│ prerequest-scripts │ 0 │ 0 │
├─────────────────────────┼─────────────────┼─────────────────┤
│ assertions │ 344 │ 0 │
├─────────────────────────┴─────────────────┴─────────────────┤
│ total run duration: 6.9s │
├─────────────────────────────────────────────────────────────┤
│ total data received: 2.47kB (approx) │
├─────────────────────────────────────────────────────────────┤
│ average response time: 5ms [min: 3ms, max: 97ms, s.d.: 5ms] │
└─────────────────────────────────────────────────────────────┘
docker compose run siege
Note:
- load testing should be executed after postman tests (for populate database with data)
- you can see siege log at
siege/log/siege.log
- load testing inside docker on same machine is not so representative. Better to use two hosts: API-server and siege-client.
- for having complex load testing (closest to real data) we need to prepare Graph with complex edges and big depth.
Siege result on my machine:
- Docker resources: 1.4 GHz Quad-Core Intel Core i5, 4 (v)CPUs, RAM 8 GB, 2 GB Swap.
Transactions: 92998 hits
Availability: 100.00 %
Elapsed time: 59.98 secs
Data transferred: 5.34 MB
Response time: 0.14 secs
Transaction rate: 1550.48 trans/sec
Throughput: 0.09 MB/sec
Concurrency: 220.02
Successful transactions: 86737
Failed transactions: 0
Longest transaction: 2.94
Shortest transaction: 0.00
Note: use button in top right corner Show full graph
or change Graph configue settings
for see whole picture.
Import collection tests/DevChallangeTrustNetwork.postman_collection.json
into Postman app.
Did not give collection public link because it can be associated with my personal data.