{"id":41572760,"url":"https://github.com/altairsix/eventsource","last_synced_at":"2026-01-24T07:48:02.627Z","repository":{"id":55381711,"uuid":"91351326","full_name":"altairsix/eventsource","owner":"altairsix","description":"Serverless Go event sourcing library built on top of dynamodb","archived":false,"fork":false,"pushed_at":"2021-01-04T12:52:12.000Z","size":74,"stargazers_count":247,"open_issues_count":11,"forks_count":39,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-06-18T18:29:17.771Z","etag":null,"topics":["dynamodb","event-sourcing","golang","serverless"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/altairsix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-15T15:05:47.000Z","updated_at":"2024-02-18T12:25:57.000Z","dependencies_parsed_at":"2022-08-14T23:00:55.054Z","dependency_job_id":null,"html_url":"https://github.com/altairsix/eventsource","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/altairsix/eventsource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altairsix%2Feventsource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altairsix%2Feventsource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altairsix%2Feventsource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altairsix%2Feventsource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/altairsix","download_url":"https://codeload.github.com/altairsix/eventsource/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altairsix%2Feventsource/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28719872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T05:53:42.649Z","status":"ssl_error","status_checked_at":"2026-01-24T05:53:41.698Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dynamodb","event-sourcing","golang","serverless"],"created_at":"2026-01-24T07:48:01.963Z","updated_at":"2026-01-24T07:48:02.620Z","avatar_url":"https://github.com/altairsix.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/altairsix/eventsource?status.svg)](https://godoc.org/github.com/altairsix/eventsource) ![Travis CI](https://travis-ci.org/altairsix/eventsource.svg?branch=master) \r\n\r\n```eventsource``` is a Serverless event sourcing library for Go that attempts to \r\nleverage the capabilities of AWS to simplify the development and operational \r\nrequirements for event sourcing projects.\r\n\r\nThis library is still under development and changes to the core api are likely.\r\n\r\nTake advantage of the scalability, high availability, clustering, and strong \r\nsecurity model you've come to know and love with AWS.\r\n \r\nServerless and accessible were significant design considerations in the creation of this \r\nlibrary.  What AWS can handle, I'd rather have AWS handle.\r\n\r\n## Installation\r\n\r\n```\r\ngo get github.com/altairsix/eventsource/...\r\n```\r\n\r\n## Getting Started\r\n\r\nThe easiest way to get started is to check out the _examples directory.  gopherfest has the \r\nmost complete example.  Before you run the gopherfest example, you'll need to (a) ensure you \r\nhave AWS credentials loaded into your environment and (b) then run:\r\n\r\n```\r\neventsource dynamodb create-table --name orders --region us-west-2\r\n```\r\n\r\n## Key Concepts\r\n\r\nEvent sourcing is the idea that rather than storing the current state of a domain\r\nmodel into the database, you can instead store the sequence of events (or facts)\r\nand then rebuild the domain model from those facts.  \r\n\r\ngit is a great analogy. each commit becomes an event and when you clone or pull\r\nthe repo, git uses that sequence of commits (events) to rebuild the project\r\nfile structure (the domain model).\r\n\r\nGreg Young has an excellent primer on event sourcing that can found on the \r\n[EventStore docs page](http://docs.geteventstore.com/introduction/4.0.0/event-sourcing-basics/).\r\n\r\n![Overview](https://s3.amazonaws.com/site-eventsource/Overview.png)\r\n\r\n### Event\r\n\r\nEvents represent domain events and should be expressed in the past tense such as CustomerMoved,\r\nOrderShipped, or EmailAddressChanged.  These are irrefutable facts that have completed in the \r\npast.  \r\n\r\nTry to avoid sticking derived values into the events as (a) events are long lived and bugs in the\r\nevents will cause you great grief and (b) business rules change over time, sometimes retroactively.\r\n\r\n### Aggregate\r\n\r\nThe Aggregate (often called Aggregate Root) represents the domain modeled by the bounded context\r\nand represents the current state of our domain model.\r\n\r\n### Repository\r\n\r\nProvides the data access layer to store and retrieve events into a persistent store.\r\n\r\n### Store\r\n\r\nRepresents the underlying data storage mechanism.  eventsource only supports dynamodb out of the\r\nbox, but there's no reason future versions could not support other database technologies like\r\nMySQL, Postgres or Mongodb. \r\n\r\n### Serializer\r\n\r\nSpecifies how events should be serialized.  eventsource currently uses simple JSON serialization\r\nalthough I have some thoughts to support avro in the future.\r\n\r\n### CommandHandler\r\n\r\nCommandHandlers are responsible for accepting (or rejecting) commands and emitting events.  By\r\nconvention, the struct that implements Aggregate should also implement CommandHandler.\r\n\r\n### Command\r\n\r\nAn active verb that represents the mutation one wishes to perform on the aggregate.\r\n\r\n### Dispatcher\r\n\r\nResponsible for retrieving or instantiates the aggregate, executes the command, and saving the\r\nthe resulting event(s) back to the repository.\r\n\r\n## Creating dynamodb tables\r\n\r\nEventsource comes with a utility to simplify creating / deleting the dynamodb tables.\r\n\r\n```\r\neventsource dynamodb create-table --name {table-name}\r\neventsource dynamodb delete-table --name {table-name}\r\n```\r\n\r\n## Development\r\n\r\nTo run the tests locally, execute the following:\r\n\r\n```\r\ndocker-compose up\r\nexport DYNAMODB_ENDPOINT=http://localhost:8080\r\ngo test ./...\r\n```\r\n\r\n## Testing\r\n\r\nThe ```scenario``` package simplifies testing.\r\n\r\n```go\r\n    scenario.New(t, \u0026Order{}).  // \u0026Order{} implements both Aggregate and CommandHandler\r\n        Given().                // an initial set of events\r\n        When(\u0026CreateOrder{}).   // command is applied\r\n        Then(\u0026OrderCreated{})   // expect the following events to be emitted\r\n```\r\n\r\n### Todo \r\n\r\n- [ ] document singleton usage\r\n- [ ] implement dynamodb to sns lambda function\r\n- [ ] implement dynamodb to kinesis firehose lambda function\r\n- [ ] document stream replay via s3\r\n- [ ] add support for terraform in tooling\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltairsix%2Feventsource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faltairsix%2Feventsource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltairsix%2Feventsource/lists"}