Opened 11 years ago

Closed 7 years ago

#421 closed enhancement (wontfix)

Support MySQL

Reported by: David Thompson Owned by:
Priority: major Milestone:
Component: programming Keywords: sprint
Cc: Parent Tickets:


MediaGoblin currently does not support MySQL. It would be nice if it did.

Attachments (1)

mysql.patch (9.6 KB ) - added by Danilo Tomasoni 10 years ago.
mysql branch against master. Conflicts fixed.

Download all attachments as: .zip

Change History (24)

comment:1 by David Thompson, 11 years ago

Elrond has mentioned that there are some difficulties associated with MySQL such as the required VARCHAR size that SQLite or PostgreSQL do not require. Elrond shared this link in the IRC that should prove useful to make variants of queries specifically for MySQL.

comment:2 by David Thompson, 11 years ago

Created a branch for testing MySQL support. It seems to work correctly so far. I haven't tested migration from MongoDB but starting from scratch with MySQL works.

comment:3 by Christopher Allan Webber, 11 years ago

Component: component1programming

comment:4 by ShawnRisk, 11 years ago

Owner: somebody removed
Status: newassigned

comment:5 by Elrond, 10 years ago

The above mentioned branch has some good ideas. We possibly should start out and pick individual changes we like from this branch and give credit to David Thompson.

Well, this feels low priority given the number of people asking for mysql support...

comment:6 by David Thompson, 10 years ago

The code in the branch is quite far behind master at this point. Maybe I could try to bring it up-to-date at some point as a proof of concept.

comment:7 by Christopher Allan Webber, 10 years ago

Keywords: sprint added

This is a good sprint project *if* someone knows mysql.

comment:8 by Elrond, 10 years ago

As I already pointed out: The code in the branch by David Thompson has some good ideas. And picking that individually might be a start.

comment:9 by Danilo Tomasoni, 10 years ago

I added a patch that can be applied on top of the official master branch to include experimental mysql support. Code review is appreciated.


comment:10 by ShawnRisk, 10 years ago

Status: newreview

by Danilo Tomasoni, 10 years ago

Attachment: mysql.patch added

mysql branch against master. Conflicts fixed.

comment:11 by David Thompson, 10 years ago

Hey! Cool to see someone wanting this feature. I went back and looked at what I had written, and decided to re-do my work in another branch.

Below is a link to a branch that adds MySQL support in fewer lines of code and is up-to-date with master.

The main issue with MySQL support is that VARCHARs must have a length. So, I've created a variant of Unicode that defaults to a length of 255 characters for MySQL. This is just a default, and the length can be tweaked on a per column basis if needed.

comment:12 by Danilo Tomasoni, 10 years ago

OMG. See this
this is gonna be a problem..

comment:13 by David Thompson, 10 years ago

Don't worry, you can use MariaDB. :)

comment:14 by David Thompson, 10 years ago

There is an issue with the branch as it is currently: Migrations are broken. Starting from an empty database works fine. Will fix soon.

comment:15 by David Thompson, 10 years ago

Updated branch to fix issues with migrations and all of the included media types.

in reply to:  15 comment:16 by Danilo Tomasoni, 10 years ago

Replying to dthompson:

Updated branch to fix issues with migrations and all of the included media types.

It worked for me, I successfully added the audio media type to my MG installation
with ./bin/gmg dbupdate

in reply to:  15 comment:17 by rodney757, 10 years ago

Replying to dthompson:

Updated branch to fix issues with migrations and all of the included media types.

I see you have 2 mysql branches. Is the correct one 421-mysql?

comment:18 by David Thompson, 10 years ago

Yes, 421-mysql is the correct branch.

comment:19 by Danilo Tomasoni, 10 years ago

will this branch be included in some release?

comment:20 by Christopher Allan Webber, 9 years ago

No comments on this in a while, my apologies.

I don't have time to pick up a database review; if someone else running MySQL is intersted in helping review this, I'd be interested in pulling it into master.

comment:21 by Matt Molyneaux, 9 years ago

Status: reviewaccepted

Doesn't look like the above branch has been kept updated. Changing to "accepted".

comment:22 by Ben Sturmfels, 8 years ago

From a strategic point of view, I'm not sure I see the benefit of supporting MySQL. It's a significant amount of work up-front, plus has ongoing maintenance overhead to ensure future changes work for both database backends. Given the limited developer resources, I think the project needs to be clear about why this is a desirable goal.

The reason possible reason I can think of for supporting MySQL is if it encouraged more people to run MediaGoblin rather than using centralised, proprietary services. Is MySQL more popular than PostgreSQL? Probably yes, due to the "Wordpress effect". But in terms of ease of deployment, you can't put MediaGoblin on $5 a year shared hosting anyway, so whether it requires MySQL or PostgreSQL seems fairly moot - you don't interact significantly with either database anyway. In contrast, supporting SQLite3 does dramatically simplify the deployment process for small sites - no additional database server at all.

PostgreSQL seems to be widely preferred amongst the Python and Django community. It has better SQL standards support and useful features like transactions around schema modifications. I hear quite a bit about switching from MySQL to PostgreSQL, but I don't think I've heard anyone going the other way.

Since MediaGoblin is an application, rather than a library, I suggest being shamelessly opinionated and sticking to a single backend. (For what it's worth, I use both MySQL and PostgreSQL in production for my day job.)

Definitely interested to hear peoples' thoughts though - especially since I greatly respect dthompson's work. :)

comment:23 by Ben Sturmfels, 7 years ago

Resolution: wontfix
Status: acceptedclosed

There haven't been any responses to my enquiries here for 12 months, so I'll go ahead and close this as "wontfix" for now. Please don't hesitate to re-open if you think there's still a good case for concurrently supporting PostgreSQL and MySQL/MariaDB.

Note: See TracTickets for help on using tickets.