-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "json as a DB" methods #30
Comments
@gentlementlegen @whilefoo @EresDev Guys pls check the description if it's worth implementing this feature |
This method should also automatically set and get the file name as the That way we will always have separate JSON files per plugin. In this repository it would be |
@rndquu As long as you can solve the fact that wallets are linked to permits and users, that with this change would theoretically be in 3 separate json files, that's ok I guess. |
We will have to introduce:
|
We will probably also have to handle:
|
It's pretty much ready yeah. I couldn't use it for
I figured as long as I pull the most recent sha as close to the write as possible and retry by fetching a fresh sha each time we'd probs be okay but reads could become stale pretty quickly.
My thoughts when building what I did:
|
Interesting idea, but I am hesitant. If we go with JSON files, plugins are going to end up dealing with database concerns like integrity constraints. This adds to the responsibility of plugins and diverts their attention from their actual concerns. The DBMS is offering us out of the box what we need now and what we will need in future. As given in the issue specs, the goal is to simplify. It is true if the JSON files are going to be modified rarely, like config files. But I see these files will be updated regularly. It seems to me it complicates things instead. |
To me it seems more like we are trying to get free hosting rather than simplifying things. Because we technically could have one Supabase DB per project which would be very simple to setup and to use, but expensive to host on Supabase itself. And we are still tied to Supabase when it comes to login and user sessions, which won't be solved by using JSON. |
I'm happy to continue on with my implementation and take on the burdens presented here. The vibe in this task feels like it headings toward a big fat no against implementing it but I also keep seeing @0x4007 repeating elsewhere that we need to get rid of the DB dependency and implement GH storage. I'm free to work on this if it's a priority and no-one else is free to |
There's no maintenance on the authentication app. Because of this, no contributors need to work on the database. In order to implement authentication in any of our apps, two strings are required: the Supabase database url and the anon key. As I understand, these are public values and can be hard coded in the apps. All the logic for apps to save and read custom app-specific data requires ongoing maintenance/changes to the database. This doesn't make sense in a DAO to manually add contributors to have access to the Supabase who may be transient (i.e. only work on one task.) QA also becomes more burdensome than it needs to be with manually adding contributors. Something like Git based JSON storage makes the most sense for app maintenance by DAO contributors. |
Ok, there's no consensus regarding whether we need to migrate all of our core plugins storages to json or not. But at least there're no objections that we need SDK methods for managing json storages. I suppose we could implement the methods and convert 1 plugin into json storage to see how it goes. |
@gentlementlegen I've probably already asked but can't find the answer, do we need to install this app and why do we even need it? |
UbiquityOS is the only app that should be used. |
The storage app was created during the first PR of telegram bot where reviewers decided using the kernel's private key was too insecure, so I made another app so we could write to a private repo.
Not required anymore. I had considered rate limits against our official app token as well but that was secondary to the above. |
/help |
Available Commands
|
/start |
! You do not have the adequate role to start this task (your role is: member). Allowed roles are: collaborator, admin. |
/help |
It makes sense to add SDK methods for storing arbitrary json in the
.ubiquity-os
partner repository.@Keyrxng implemented smth similar but I'm not sure if it's production ready.
What should be done:
.ubiquity-os
partner repository. You may use a 3rd party npm package like https://github.com/typicode/lowdb or https://github.com/Belphemur/node-json-db of https://github.com/gitrows/gitrows. In the end each plugin should correspond to its ownplugin-name.json
file.Right now our biggest DB table is the
permits
table with 314 rows (except for thelogs
table which has 1M rows). This is not that much. In theory we could ditch the supabase DB at all and use only json files as a DB until we hit optimization issues. Json as a DB has lots of cons but simplicity (in some cases) outweighs them.I feel like it's better to use a "single json file per plugin" approach compared to making supabase DB consistent and maintaining its single instance for all of the core plugins.
The text was updated successfully, but these errors were encountered: