Giter Club home page Giter Club logo

Comments (4)

jeremydmiller avatar jeremydmiller commented on August 29, 2024

"Is my understanding correct that the new FetchForWriting API is currently not usable for MultiStreamProjection cases?"

Correct. It's only usable for single stream projections. Its whole point was for "write" models in command handlers. There's no easy way you could adapt that for multi-stream projections if you think about it for a bit.

from marten.

jeremydmiller avatar jeremydmiller commented on August 29, 2024

Improve the docs and make FetchForWriting() do an assertion if you try to use it w/ a multi stream projection

from marten.

CptWesley avatar CptWesley commented on August 29, 2024

@jeremydmiller

I understand that for using them as write models this does not make much sense (and goes against certain DDD principles). but in this particular cases I was actually trying to create a read-model. I hoped this could benefit from the cool zero-downtime versioned mechanics for FetchForWriting described here https://jeremydmiller.com/2024/03/05/marten-7-makes-write-model-projections-super/

I'm not that familiar with the actual implementation, but I feel like it must be possible to have a similar mechanic for multiple source streams. But this is ofcourse talking about the solution, not the actual problem. I'm mainly trying to find a way to avoid the situation where we have to take down all our pods when deploying a new version in order to rebuild our multi-stream projections instead of our regular Blue/Green deployments. Or even worse: a developer forgetting to rebuild a business-critical projection leading to incorrect results being passed down to the next business unit.

from marten.

jeremydmiller avatar jeremydmiller commented on August 29, 2024

@CptWesley The problem is that there's no easy way for Marten to reason about exactly what the events are for a multi-stream projection. Plus FetchForWriting() also does some locking work on the stream table. It's very much purpose written for "write" models on a single stream at a time.

What you're trying to do is definitely an interesting use case suggestion, but you'd need a brand new API and mechanism for doing that.

from marten.

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.