Standard ReadModels
Closed this issue · 4 comments
How already proposed in chat, what about standard read models in this package?
e.g. MongoDB, ElasticSearch, Memcache and Redis should almost be the same and easy to implement.
Can you please post what a standard read model should look like in mongodb f.e.? What about indexes?
I think MySql is problematic, as you have to create a schema upfront.
Here is an example for elastic search:
https://gist.github.com/oqq/3fb868d1bf8d033117be6cf40eacf608
MongoDB should look similar with a collection injected instead of client & index.
Indexes could be provided with a service or simply omitted in most cases.
I have same thoughts about mysql.. But all storages without the need to provide a scheme in upfront should be possible.
I see what you mean. However adding all of them to a single repo might be problematic. For MongoDB you need the mongodb-extension, for Memcached you need memcached-extension, for ... you get the point.
Maybe this would be a great addition for the docs/gists/blogposts instead?
Provide a package for each is to much and that extension issue is a good point to not implement it in one package.
In anyway we should provide such examples to give some tools.
But yes, also docs and blogposts are fine for that.
First gist is created. Let me know if you need some more examples for docs. ;)