Application component 1(ap1) record/insert/update a new state in graph database(neo4j)

For every new state change in the database, application component 2(ap2) needs to be informed/notified that a new entry(event) is made. ap2 would not like to poll database and track/find for state change.

enter image description here

ap2 should not know the existence of ap1

Both application components will be written in GoLang

Database supports triggers & Stored procedures functionality. It is neo4j database.

OS Environment is Linux

I came across this article on notification: http://graphdb.ontotext.com/documentation/free/notifications.html

What is the design pattern to make ap2 listen to any new event(immediately) on a database update? without ap2 tracking & polling state changes in database

  • 1
    Please don't cross post to multiple sites. Please read about asking appropriate & good questions for a site. How to Ask
    – philipxy
    Commented Sep 13, 2020 at 5:45
  • @philipxy We are stuck with this design scenario... that we are looking to resolve. Question is very clear and precise. Instead of polling database for data changes, application layer needs notifications of those. Isn't this clear? Commented Sep 13, 2020 at 5:56
  • @philipxy I learnt that SE site is more appropriate for such questions Commented Sep 13, 2020 at 5:58

1 Answer 1


My first comment is that integrating through a database is an anti-pattern. You should strongly consider a different approach.


That said, Domain Driven Development has the concept of Domain Events that you might want to look into https://docs.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/domain-events-design-implementation

It might be that the insert/update is not related to a domain event. Then you might want to consider to have the application doing the insert also trigger the event.

  • How can an application doing the insert also trigger event? Because we do not want ap2 to know the existence of ap1. Commented Sep 13, 2020 at 17:07
  • I don't agree with Ben morris. Arista EOS is designed on same pattern. CA NSM is designed on same pattern. Commented Sep 14, 2020 at 5:20
  • 2
    “How can an application doing the insert also trigger event?” – ap1 doesn't have to directly trigger an event in ap2, it can publish the event to a message broker (like RabbitMQ or Kafka). ap2 can subscribe to this event in the broker. This way ap1 and ap2 don't know about each other, they only know about the broker.
    – Archie
    Commented Sep 15, 2020 at 13:04
  • @Archie if I use kafka, then why would I need database? Commented Sep 23, 2020 at 4:15
  • Because Kafka in not a database. Neither is RabbitMQ which I have also mentioned.
    – Archie
    Commented Sep 23, 2020 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.