Skip to content

Understand how MongoDB transactions lock documents to avoid concurrent access

Notifications You must be signed in to change notification settings

alcortesm/demo-mongodb-transactions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Intro

The purpose of this project is to explore how MongoDB transactions can be used to ensure consistency of Domain Drive Design (DDD) aggregates.

Run the demo

The internal/e2etest.Test_Concurrency_AddLotsOfUsersConcurrentlyToGroup test verifies Mongo transactions allows to keep DDD aggregates consistent when facing concurrent calls in our application layer.

The easiest why to run the test is running all the test in the repo:

; go test ./...
ok      github.com/alcortesm/demo-mongodb-transactions/internal/application     (cached)
?       github.com/alcortesm/demo-mongodb-transactions/internal/testhelp        [no test files]
ok      github.com/alcortesm/demo-mongodb-transactions/internal/domain  (cached)
ok      github.com/alcortesm/demo-mongodb-transactions/internal/e2etest (cached)
ok      github.com/alcortesm/demo-mongodb-transactions/internal/infra/mongo     (cached)

About

Understand how MongoDB transactions lock documents to avoid concurrent access

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages