-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Rewrite the DB system to be actually... good. #194
Comments
As a side-note: Some form of functionality should be added to handle Nick objects in a meaningful way. |
I've been discussing how to track when users have multiple nicks, for the purposes of retrieving settings etc., in #tech with Kylie. It looks like the best way is to have a Nicks table, with an id, slug, and canonical Nick. When a user wants to add an alias, she can When an unregistered user sets a setting, or a new Nick entry is otherwise needed, a registration entry should be created automatically. A |
Using the DB system for reminders/tells has been suggested, and I think it's a good idea. This use case is worth considering when designing the new API. Tells currently store from, to, verb (ask or tell), time sent, and message, while reminders store timestamp at which to remind, channel to remind to, whom to remind, and the message. I think that would probably best be served by two tables. |
channels and users in their own tables! this allows for better normalization |
Any chance that this change will include PostgreSQL support? |
I personally have no knowledge of PostgreSQL, @triplem, but if you're willing to help I'll make sure to poke you once the db is properly setup for both sqlite and MySQL so we can take a look. |
Yeah, why not. Probably something like SQLAlchemy would be another choice? This provides already a very good abstraction layer and modules could use this as well for additional database storeage. |
It's been a long-standing goal not to introduce dependencies into any API-level functionality - including the database. As far as which backends we'll be supporting, SQLite is the first priority. Really, given the scale and nature of the data we're dealing with here, anything else is overkill. Supporting MySQL (or rather MariaDB, since the plurality of our devs are on Fedora) will come second, after SQLite is stable. Anything else will be "patches welcome". |
I'm leaning toward dropping the idea of Willie's DB being a full query-writing engine, since it's never done that terribly well and will never do it as well as SQLAlchemy. Instead, what I'm thinking is having I say "key-value store", but I'm not suggesting we use MongoDB, even if it is web-scale. Basically, we'd have a (My|Postgre)SQL(ite) db with two tables (id, slug, nick) and (id, key, value), for users; and two tables (id, slug, channel) and (id, key, value) for channels. RSS and other modules would make, write SQL for, and do what they need with their own tables. |
Why not a simple json file then? it'll eliminate 3rd party deps. -Elad Alfassa. |
You mean, like a dict? =/ |
There are a few reasons why I still think an actual DB is a good idea:
|
I've started poking at this (see 6f63f7b). I'm following what was said above about a simple key/value store for nicks and channels. Query writing will be dumped entirely, save for the k/v stuff, with just a shell method to do simple executions, but I haven't looked at that too in-depth yet. |
Would modules still be able to create their own tables and manage them how they wish? Also if not would their be an alternative if it is not Nick based? |
You'll still be able to do what you want with the DB, you'll just have to do it in SQL. (Or bring in something like SQLAlchemy. I'll probably write something up on how to do that.) |
Is there a way that you could maybe have the old DB system in a separate John Lage On Fri, Aug 1, 2014 at 7:28 AM, Edward Powell [email protected]
|
Why would we do that? It's a major version increase for a reason. API should be expected to be incompatible with 4.x |
Good Point, nevermind previous comment from me. John Lage On Fri, Aug 1, 2014 at 10:11 AM, Dimitri Molenaars <[email protected]
|
I just had to use the db system for the first time today. It sucks ass. We really need to fix that. @embolalia if SQLAlchemy will make things easier, than we can use it. Introducing deps is better than having a shitty API. |
The rewrite is done, but there are still some more tasks left. I've added a tasklist to the OP to keep track of them. |
I don't want to delay this any more than it already is, so I'm dropping the SQLAlchemy helpers. Once this issue is closed, I'll create another one to track that (likely also perennial) task. |
Create SQLAlchemy schema representationDocument how to use SQLAlchemy with new dbBetween using Django's DB wrapper system for another project and trying to make rss work with Willie's DB, I've realized Willie's DB wrapper is kinda shit. It's great for preferences stuff, but it does not scale well. So at some point, it should be rewritten to include such illustrious features as the ability to return more than one row and perform more complicated SELECT statements.
The text was updated successfully, but these errors were encountered: