SPIKE: `PaperTrail` ?
nelsonic opened this issue ยท 7 comments
Investigate if we can use PaperTrail
: https://github.com/izelnakri/paper_trail
to store version history of items
in our App
(MVP
).
Todo
- Read through the source of https://github.com/izelnakri/paper_trail
and determine if it already has the features we need for ourApp
.
Ultimately what we want is an Operational Transform Log dwyl/app#276
so that changes made in our App
can easily be "replayed" by someone joining a team
or undone if the change is not desired.
If PaperTrail
can enable this, we should consider using it because it appears to be maintained. ๐ญ
After mentioning in dwyl/app#276 (comment), I look at other options but only Delta
for Elixir seemed to exist when it comes to OT. PaperTrail
seems the better option for me, though. If we are using OT just for logging and we want to store them, PaperTrail
seems to do just what we want. If we used Quill's or Delta for Elixir, we would have to repeat the work PaperTrail
did by setting up this behaviour with a database.
@LuchoTurtle thanks for taking a look at this. ๐
We need to understand what the pros/cons of using PaperTrail
will be.
If you want to dive into this, go for it.
Basically we want to maintain a complete history of every action performed in the App
so that people can easily undo/redo any change that they make.
We need to store the data in the most efficient means possible so that our storage costs don't break us.
If we need to derive our own algorithm we will. But if something already exists, we should 100% use it. ๐ญ
From what I've tinkered with PaperTrail
, it seems to work perfectly fine out-of-the-box and does exactly what is written on the tin. I've noticed that only insert
, update
and delete
operations are "tracked". I thought, from a logging and analytics perspective, tracking queries would also be a bit useful (though not as much).
I understand that mutations and actions that change the data are much more important but I thought I'd share this.
@LuchoTurtle thank you for insightful Demo during standup. It looks like we can use PaperTrail
for our MVP
. ๐ค
We need to have a standalone demo App for PaperTrail
so that everyone in the team/community can understand it. ๐
The https://github.com/dwyl/phoenix-papertrail-demo README.md
outline should be a good guide. ๐
But if you have any specific questions, please ask. ๐
This should be closed due to https://github.com/dwyl/phoenix-papertrail-demo
Thanks again @LuchoTurtle ๐