Git Product home page Git Product logo

Comments (4)

adrai avatar adrai commented on June 25, 2024

It depends on your system but basically you need to wrap for example es.getEvents() with a rest service or a dedicated channel on the messageBus.
Then when you want to rebuild you can ask that service to return your events by streaming or I would recommend to implement some sort of pagination...

from node-eventstore.

josh0707 avatar josh0707 commented on June 25, 2024

Thanks.
Basically, I could do:
client ---Rest (rebuild request)--> Host Server: rebuild-readmodel method (request events) ---MessageBus--> EventStore (es.getEvents()) ---MessageBus--> Host Server: rebuild-readmodel method (eventdenormalizer.clear();eventdenormalizer.replay())

The rebuild-readmodel method would be accessible via a Rest request to the Host Server and would send a messages to the EventStore to get the events before requesting the Eventdenormalizer to perform a replay.
Does it sound right? ...

from node-eventstore.

adrai avatar adrai commented on June 25, 2024

There is no correct or incorrect... just do what best fits in your system.
Usually in my systems I do not request for a replay from client side. I do it on the operations side (i.e. while deploying a new release) => so each time a new ReadModel have to be (re)created the denormalizer processes are started with a special environment variable or flag and then they will request all events (in pages) via REST from a "replay-service" that queries the events from the eventstore.

from node-eventstore.

josh0707 avatar josh0707 commented on June 25, 2024

Thank you for the explanation.

from node-eventstore.

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.