I am working on an events ticketing system and I am trying to use DDD. However, I am unsure about how to model some of my aggregates.
I have the main Event aggregate:
public class Event : Entity<Guid>, IAggregateRoot
{
public string Name { get; private set; }
public Organizer Organizer { get; private set; }
public Venue Venue { get; private set; }
public DateTime StartsAt { get; private set; }
public short MinAge { get; private set; }
public bool IsAvailable { get; private set; }
public EventType Type { get; private set; }
//constructor and mehtods
}
and also have the Venue and Organizer Aggregates:
public class Venue : Entity<Guid>, IAggregateRoot
{
public string Street { get; }
public Venue(Guid id, string street) : base(id)
{
Street = street;
}
}
public class Organizer : Entity<Guid>, IAggregateRoot
{
public Organizer(Guid id) : base(id)
{
}
}
My questions are:
I have different services that handle creation and other operations for the Venues and Organizers. The Events service is consuming kafka messages from the other two services and persists the venues and organizers in its own database. I would like to mention that the Venues and Organizers services have a lot more information about their respective entities than the Events service, so it is not a 100% data duplication. Is this the right way to share data between different services?
In the events service, should the Organizer and Venue be considered an aggregate or an entity? Neither of those is accessed on itss own in the context of the Event service.
How should I handle persisting and retrieving entities from the database?