Create apis , first one will create and enitity A, second one will create relationship with that one and another entity B. if B doesn't exists create it. then another api to collate the data, giving all aggregated values of all As attached to B. also event bus to propagate events to all handlers,