{"id":34808266,"url":"https://github.com/elgopher/batch-example","last_synced_at":"2026-05-24T06:34:10.560Z","repository":{"id":39662710,"uuid":"494991919","full_name":"elgopher/batch-example","owner":"elgopher","description":"Web application example using elgopher/batch package","archived":false,"fork":false,"pushed_at":"2022-05-28T14:15:52.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T10:17:51.582Z","etag":null,"topics":["batch","batch-processing","go","golang","high-performance","high-throughput"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elgopher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-22T07:39:39.000Z","updated_at":"2022-08-16T08:24:06.000Z","dependencies_parsed_at":"2022-09-20T07:41:17.107Z","dependency_job_id":null,"html_url":"https://github.com/elgopher/batch-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elgopher/batch-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgopher%2Fbatch-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgopher%2Fbatch-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgopher%2Fbatch-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgopher%2Fbatch-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elgopher","download_url":"https://codeload.github.com/elgopher/batch-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elgopher%2Fbatch-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28028982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch","batch-processing","go","golang","high-performance","high-throughput"],"created_at":"2025-12-25T12:11:12.118Z","updated_at":"2025-12-25T12:11:12.823Z","avatar_url":"https://github.com/elgopher.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Batch example\n\nWeb application example using [github.com/elgopher/batch](https://github.com/elgopher/batch) package.\n\n## How to run?\n\n* Install docker, docker-compose, curl\n\n* Start web application with Postgres database\n\n`$ docker-compose up`\n\n* Buy a train ticket\n\n`$ curl -v \"http://localhost:8080/book?train=batchy\u0026person=elgopher\u0026seat=3\"`\n\n## Load testing\n\nYou can run [script.js](script.js) in [K6](https://k6.io) by executing:\n\n`$ docker run --network batch-example_default --rm -i grafana/k6 run - \u003cscript.js`\n\n## Why optimistic locking was used?\n\nBecause [optimistic locking](https://www.martinfowler.com/eaaCatalog/optimisticOfflineLock.html)\ndoes not require having long-running transactions, which\nin turn consume database connections. This is especially important here, because batches \ntakes significant amount of time (more than 100ms). With the use of optimistic locking\nthis example application could handle 100k+ requests per second using just 100 \ndatabase connections.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felgopher%2Fbatch-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felgopher%2Fbatch-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felgopher%2Fbatch-example/lists"}