GithubHelp home page GithubHelp logo

Is there any recommended way how can we configure projection handlers to generate the read models for the event sourced grains? about orleans HOT 4 CLOSED

AlexandrIalticenco avatar AlexandrIalticenco commented on May 29, 2024
Is there any recommended way how can we configure projection handlers to generate the read models for the event sourced grains?

from orleans.

Comments (4)

smfields avatar smfields commented on May 29, 2024 1

Another option to consider is using a mechanism built-in to your storage provider. For instance, if you store your events in EventStoreDB then it can create the projections for you.

I didn't look closely at the sample you linked, but you have to be careful about persisting state and publishing events in separate actions. When you do that, there's a chance, however small, that something happens between when you save to the database and when you publish the event that causes the event to never get published.

Event sourcing can sidestep this issue by making the persistence of the state and the publishing of the event a single atomic action, but only when you use a supported event store.

from orleans.

smfields avatar smfields commented on May 29, 2024 1

@AlexandrIalticenco you're also welcome to look into Orleans.EventSourcing.EventStorage. It's a library I'm working on to add support for using an external event store with Orleans event sourcing.

The package I linked is for the base library that you could build your own storage on top of, but I've already got other packages made for common event stores like:

It's still a bit of a work in progress, but it does have nuget packages published if you want to start using it, or you can use it as inspiration for your own solution.

from orleans.

AlexandrIalticenco avatar AlexandrIalticenco commented on May 29, 2024

Actually I found the answer on my question here https://github.com/pmorelli92/Orleans.Tournament?tab=readme-ov-file#cqrs-projections-event-sourcing-and-eventual-consistency.

There is a really nice diagram describing the whole flow I need (copying from there if it can be useful for anyone).
image

from orleans.

AlexandrIalticenco avatar AlexandrIalticenco commented on May 29, 2024

@smfields thank you for your response. Yes, the sample I linked has exactly the problem you are talking about "You have to be careful about persisting state and publishing events in separate actions."

We are considering now to apply the solution you described by using custom log consistency storage provider.

from orleans.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.