You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applies schema-based sharding for the connect four database #119.
The application itself only knows about logical shards and relies
on a proxy, such as ProxySQL, to forward queries to physical shards.
* The env variable APP_CONNECT_FOUR_DOCTRINE_DBAL_SHARDS
defines a comma-separated list of active shards. As games can
be sharded across multiple physical databases, the transactional scope
(technical-wise) is moved to the repository layer, and removed from the
application layer. The changes to the repository, which is now very
persistence oriented, aim to make this explicit. The shard selection
happens based on the game id.
* The env variable APP_CONNECT_FOUR_DOCTRINE_DBAL_DATABASE
is introduced to allow selecting a shard for database creation and
migration, as doctrine commands currently don't allow passing
the database name via cli arguments.
* Besides the repository, the event store access must also be
aware of sharding, since this is read when the query model is not
yet populated. For that matter, to query the events from the
write model, the repository is used, which encapsulates the
EventStore.
* Remove query model's GameNotFoundException
This is an aside refactoring, not related. This indirection
wasn't needed in the past. Additionally, an instance of
GameId is required to find a game, not a loose string.
* The current implementation doesn't take resharding into
consideration.
0 commit comments