Code Monkey home page Code Monkey logo

Comments (2)

CodeWithKashif avatar CodeWithKashif commented on May 22, 2024 1

Thanks a lot for such a detail answer, now I am very much aligned with your vision.

Thanks for teaching this
"Do you want availability: choose the event way. If availability is less important and you need consistency, choose for getting the data from the system of record at the time you need it (this creates a runtime dependency)."_

I have few more questions around event storing, that i will be posting that in a different thread.

from pitstop.

EdwinVW avatar EdwinVW commented on May 22, 2024

Hi @findkashif. Thanks for that great compliment!

Regarding your questions:

  1. The reason for separating the API and eventhandler, is autonomy of the individual services. The eventhandler will ingest events from other domains (customer / vehicle) even when the API is offline for maintenance. It's all about separation of concerns and the ability to release components with a different release cadence.

  2. The reason is mainly for demonstration purposes. Within Pitstop, I use 2 mechanisms for getting data from other domains: through events (as with the Invoiceservice for instance) or by calling an API at the moment you need the data (as with the VehicleManagementAPI). In every scenario, you should choose one or the other mechanism - fit for your requirements. Do you want availability: choose the event way. If availability is less important and you need consistency, choose for getting the data from the system of record at the time you need it (this creates a runtime dependency).

  3. Within the WorkshopManagement domain, I've chosen to name the cached customer and vehicle data (received through events) "reference data" because it is created in a different domain. Also, the reference data is a relational read-model whereas the state of the WorkshopManagementAPI is stored in an event-store. For separation of concerns, I've separated these two in separate controllers and repositories.

  4. A fanout exchange in RabbitMQ is the simplest way of doing pub/sub. A message sent to this exchange is simply copied to all queues bound to the exchange. This is all I needed for Pitstop, so I picked this exchange type (see also: the RabbitMQ docs).

I hope these explanations are clear and answer your questions @findkashif!

from pitstop.

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.