Giter Site home page Giter Site logo

Comments (4)

pavankjadda avatar pavankjadda commented on September 9, 2024

I saw your updated documentation. However, I still have some questions

  1. JSON serialization is flexible. So when an Order is deserialized into Invoice and Delivery just the needed data is read, How is this possible? I know they use the same topic, but no relation exists between Order and Invoice i.e foreign key
  2. Things become complex when if no such relation exists. Order data on Kafka consumed by Invoice and Shipping. Since there is no relation between Shipping and Invoice, Invoice may consume one Order object and shipping may consume different Order object. When the user pulls his order information, he may not see correct information.
    I looked at other implementations, they deserialized Order (in their case Car) object on another microservice. Am I missing something here?

from microservice-kafka.

ewolff avatar ewolff commented on September 9, 2024

1 - The attributes in Order, Invoice and Delivery have the same names. So a serialized Order can be interpreted as an Invoice or a Delivery. The additional attributes are ignored.
2 - The Order has an ID that is also present in Invoice and Delivery. So there is a relation.

from microservice-kafka.

pavankjadda avatar pavankjadda commented on September 9, 2024

Got it. In large enterprise applications do you think it's a good idea to have the same id for all the Objects? Let's just say we have custom order id: ORD112-34-44847477 for Order and as per your implementation Invoice and Delivery will get the same ID which has ORD in it, which confuses users. I think it's better to have a unique id (invoice_id, delivery_id) for each object based on object/microservice name and have the ID attribute for relation. What do you think?

from microservice-kafka.

ewolff avatar ewolff commented on September 9, 2024

You need to correlate orders to invoices and deliveries. I am not sure how that should be done if the invoice and delivery do not contain the id of the order. Note that there might still be an additional invoice or delivery id.

from microservice-kafka.

Related Issues (17)

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.