question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support "domains" for events and services

See original GitHub issue

Be great to support domains for events and services and maybe even a new page that shows users their domains where they can see services and matching events within that domain.

Questions we need to think about

  • Can events/services belong in more than 1 domain?
  • Can events/services only have 1 domain?
  • Where should we store the domain? Guess the events and service can have a new property called domain.

Any ideas/thoughts anyone?

Be good to get some ideas going on this one.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
boyney123commented, Mar 7, 2022

Going to close this issue now that EventCatalog now supports domains 😃

1reaction
jirayrvacommented, Feb 20, 2022

Hi @boyney123,

I think (sub)domains is a very much needed feature. Without it, everything is sort of defined in one “global” domain which is too messy for a real-world scenario.

TL;DR

  • an event/service belongs to one subdomain only
  • an event might belong to one specific entity within the subdomain
  • subdomains might be nested (in a hierarchy)

Long version

On sharing events between subdomains

In my experience, coming from a Domain-Driven design (DDD) perspective, all services and/or events fall into a subdomain (more on this below). If the same event is needed in another subdomain, it just happens to be a copy of it, and that’s the whole “bounded context” idea. But I would argue that you wouldn’t even have much of that (events shared between subdomains), if you are respecting the boundaries between bounded context. Ultimately, an event is a notification that the state of the system has changed. If two subdomains are publishing the same event, that practically means, two subdomains are doing the same change in the system, which most probably indicates that the two subdomains have write access to the same data. That violates data ownership principle.

Even when two subdomains have events with similar names and schema, the fully-qualified name/type of the event would be different since it would include the subdomain (assumptions)

Furthermore, subdomains should enable autonomy. Meaning, you can change an event without having to revisit the entire system. Thus, having events shared between subdomains will only tangle these subdomains and prohibit autonomy.

These are all arguments to say: events belong to one subdomain only.

On having entities in the subdomains

In reality, we define a hierarchy of subdomains (hence the sub in subdomain), which is convenient for enterprises where products are split upon multiple teams. Then, we define the entities/aggregates in those subdomains. We see these more like objects in Object-Oriented Programming (OOP) sense. Thus, each entity has a set of commands and these commands result in changing the system. The critical principle here is that, if a service changes the state of the system it must notify the world about the change by publishing an event. Thus, events are defined within entities. Multiple commands within the same subdomain might publish the same event. This sharing is safe as long as these commands are within the same subdomain (unlike sharing commands between subdomains)

From a practical approach, the hierarchy of subdomains is not critical to have. On the other hand it would be great if there is the capability to define which entity within the subdomain does the event belong to. Maybe another tag called entity or aggregate

Disclaimer: many assumptions are made in my comments above (mainly, strong DDD), which may not hold true in different contexts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event Domains in Azure Event Grid - Microsoft Learn
An event domain is a management tool for large number of Event Grid topics related to the same application. You can think of...
Read more >
About .events domains - Google Domains Help
About .events domains ... Select a category below to get information about price, terms and restrictions, registration details, privacy protection, and more for...
Read more >
events Domain Registration | Buy a .events New gTLD for $8.98
Register your .events for $8.98. This New gTLD is perfect for Marketing, Social & Lifestyle, Services websites and opened for General Availability on...
Read more >
About .EVENTS domains | Domains - GoDaddy Help US
This domain offers distinctive web addresses to concert promoters, event planners and any business that wants to advertise its events with a specially ......
Read more >
What are Domain Events? | DDD - Serialized
You can use Domain Events to integrate services with each other. They are a very useful way to publish information about what happened...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found