Skip to content

Federation: Triggering Update Activities

I need to update backlinks in two cases:

  • When the url is changed (#237 )
  • When I change the value of a one-to-many or one-to-one relationship

As I'm not able to access the old value in Django without storing it, this information will need to be deduced sender or receiver side

As a solution I propose using a subscription-based solution like with DjangoLDP-Notifications.

  • Whenever I create a backlink I follow-up by sending a request to subscribe to it
  • Whenever the resource is saved, I send the Update notification to all subscribers on the resource

This solution is clean, but a little greedy with bandwidth. It could be made to use less bandwidth by having the sender register/unregister the subscription when the backlink is generated, so the receiver need not request it. Having an endpoint to register a subscription has the added benefit that third parties can subscribe to changes on the model

What do you think @jbpasquier @sylvain @balessan ? I suppose this would raise the question of integrating DjangoLDPNotifications into DjangoLDP again 😅

TODO:

  • backlinks subscription service
  • permissions for subscriptions.. #236
  • possible integration with DjangoLDP-Notifications
Edited by Calum Mackervoy