How to create a notification system when using hybrid databases

I am using a hybrid database (graphical DB and RDBMS) for the social website I am developing. I store "related" data, such as friendships between users, in the graph database, and I store less connected data, such as user authentication information, notification data in RDMS (SQL Server). Now that two users become friends, I save their relationship in the neo4j database and should notify users. The first task is very trivial, and for the second task I am going to create TransactionEventHandlerone that will work when creating a new relationship :FRIENDS(see this link ).

However, since I use the Notification table in RDMS to store notifications, I'm a little confused about what to do after the event generated by the relationship fires. I have two possible options:

  • Move the notification throughout the graph database and create a node link :NOTIFIEDbetween both the user and the notification nodes. But in this case, I can’t understand how to notify the application of newly created nodes.

  • Access the SQL Server database using jdbc and add a notification to the notification table when an event occurs. And the user SqlDependencynotifies the application of changes in the notification table.

So which option is suitable in terms of performance and scalability? Or is there a better alternative?

If that matters, I use ASP.NET MVC for server-side programming.

+4
source share

All Articles