didx-xyz / ssi-trust-registry

Trust Registry for Self-Sovereign Identity Ecosystems
Apache License 2.0
6 stars 3 forks source link

feat: mongo transactions #198

Closed niall-shaw closed 9 months ago

niall-shaw commented 10 months ago

Solves the same problem as https://github.com/didx-xyz/ssi-trust-registry/pull/197, but by using transactions instead of manual deletions / updates. This has the added benefit of not exposing any unnecessary delete functions, but requires some extra overhead of creating and passing a mongo session.

Sessions and transactions require mongodb replica sets, which is why there were several changes required to be made to the docker-compose.

I believe this is the better/correct approach, as production uses replica sets anyway.

Unfortunately, it isn't possible to start the default github actions' mongodb service with replica sets, hence the use of the third party action.

Working with docker-compose, tilt, local development (i.e. yarn dev) and CI.

Note: For local development, or environments using single node replica sets, you must include ?directConnection=true as part of your connection string.