prooph / standard-projections

Standard projections to use with Prooph EventStore
http://getprooph.org/
BSD 3-Clause "New" or "Revised" License
15 stars 4 forks source link

Standard ReadModels #6

Closed oqq closed 7 years ago

oqq commented 7 years ago

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.

prolic commented 7 years ago

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.

oqq commented 7 years ago

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.

prolic commented 7 years ago

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?

oqq commented 7 years ago

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. ;)