Hey All,
I just wanted to start a discussion based on some recent experiences I had in playing around in trying to build a Rails based implementation of the ActivityPub specification.
I want to quickly preface this by saying that one of my main motivations in trying to do this was precisely because I feel like a pretty crappy developer and having a read through the specification this seemed at first glance like something that would push me to become a better developer in the process because many decisions are already made for me and all I had to do in my mind was translate the spec into Ruby / Rails conventions.
However, I super quickly ran into some problems of how the hell do I actually model this data using ActiveRecord. I know it is possible because one of the more popular implementations of the specification is in fact a Rails application.
So I mean it isn’t some impossible task to go and look at the schema.rb file and reverse engineer one way of approaching this. I explored a few different ways of approaching this including this new pattern coming to Rails 6.1 but it feels like what I actually want is to use a graph database (standard disclaimer that as a junior developer I am likely totally wrong here and am extremely open to someone pointing that out).
So while this question comes from a somewhat selfish need I think it would be reasonable to say that there are entire swaths of applications where graph databases do make a lot of sense and I don’t know that Rails has a good answer for them yet.
I want to point out that gems do exist but only really at the level of here is a one to one relationship between this gem and this particular variety of a graph database (afaik).
My questions are:
- Should we think about making graph databases a more comprehensive part of the Rails story / experience?
- I feel like many of the major flagship Rails applications out there (Shopify, Basecamp and Github) all have elements of things like “activity feeds” and need to do them at scale. Is everyone just using ActiveRecord for this? Any patterns or guides on how they approach this?
Lastly, if anyone is feeling particularly generous and wanted to point me in the right direction of explaining how they might think about modelling things from something like the ActivityPub or ActivityStream specifications in a “Rails way” I would be incredibly open to any of your thoughts in the hope that I might learn something new
Cheers!
Mark
P.S Paging @Brian_Underwood1 / @Brian_Underwood not sure if you’re currently on here but you seem like a man who has spent many many years thinking about this exact problem. Would love your thoughts if you happen to see this.