ASOS / SimpleEventStore

SimpleEventStore
MIT License
81 stars 24 forks source link

Added autoscale option support #65

Closed geruchvitaliy closed 6 months ago

geruchvitaliy commented 3 years ago

Added autoscale option support into collection and database options, so contributor can choose which scale model to use - Auto or Manual.

Manual scale model used as default, so package is compatible with previous versions.

asosMikeGore commented 3 years ago

@geruchvitaliy wondering what you think to having the collection & db initialization in the code base compared to leaving this up to an infrastructure as code tool e.g. Bicep? When we initially put together the library there wasn't support in ARM templates to manage collections which was one of the reasons we added it in.

Just thinking whether this provides a way of simplifying the library - the main risk would be though that collections are added that don't have the correct schema. However, we could check for this, rather than creating the collections etc. I'll ask some of our engineers for feedback here too.

afscrome commented 3 years ago

I'd +1 removing initalisation code from the library. Several times now we've had to play catch up to new cosmos features (#37, this PR). Especially with the recent remove of the stored procedure this is easier than ever.

afscrome commented 3 years ago

That said, it may still be useful to have some helpers to do basic initialisation of a collection - this could particularly be useful for local dev environments using hte Cosmos emulator.

geruchvitaliy commented 3 years ago

Removing the initialization code, I think, it's a different topic and it is out of scope this PR.

Yes, I agree, the initialization code need to be removed, the package should simply take existing resources and does read or append events.

asosMikeGore commented 3 years ago

@geruchvitaliy I agree that removing the initialization code is outside the scope of the PR. @afscrome good point about the local dev experience.

I suspect a sensible middle ground is we leave the ability to initialize the collections with the expected schema & indexes, but remove any form of scaling config. That then makes it easy for local dev and then in deployments to test & prod environments rely on infrastructure as code tools to configure the collections, scale settings etc.