replace serialized data in aiki configs

Bug #689904 reported by rejon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PPL
Won't Fix
High
Unassigned
scalejournal
Won't Fix
High
Unassigned

Bug Description

Serialized data is evil! its inefficient and much better to just use a proper data type IMO. Since we rely so heavily on database and needing mysql, we should be super clean about ONLY using sql IMO.

I changed on config and borked scale! So, I had to fire up a stupid commandline client and enter this:

update aiki_config SET config_data='a:8:{s:4:"site";s:7:"default";s:3:"url";s:24:"http://scalejournal.org/";s:13:"default_chmod";s:4:"0775";s:11:"pretty_urls";s:1:"1";s:16:"default_language";s:7:"english";s:19:"default_time_format";s:9:"d - m - Y";s:8:"site_dir";s:3:"ltr";s:19:"language_short_name";s:2:"en";}' WHERE config_id=1 AND config_type='global_settings';

That is insane because I had to hand edit and count the characters of the string. Databases are used to store data, not have a data structure inside a storage system.

This is a high necessary fix.

If anything, we should provide easy access to creating proper fields on the db.

Revision history for this message
rejon (rejon) wrote :

I could pile on more projects, but doesn't help because we have 1 person bus count on this.

Changed in openclipart:
status: New → Confirmed
Changed in scalejournal:
status: New → Confirmed
Changed in openclipart:
importance: Undecided → High
Changed in scalejournal:
importance: Undecided → High
Changed in openclipart:
milestone: none → 2.9
Changed in scalejournal:
milestone: none → 2010.12
Changed in ppl:
importance: Undecided → High
milestone: none → 0.2
Revision history for this message
rejon (rejon) wrote :

Other arguments against:

http://www.mysqlperformanceblog.com/2010/01/21/when-should-you-store-serialized-objects-in-the-database/

But, for me, its a history thing! just like aikimarkup, it adds one more layer of extra stuff to learn and is another shortcut taken early in aiki that is slowing us down.

Revision history for this message
rejon (rejon) wrote :

"Josh Berkus (of PgExperts) calls this serialization E-blob. Much like EAV, he criticizes this as one of 10 ways to wreck your database (slides). I tend to side with Josh. I’m optimistic that this design has its place in a smaller component of your application, but I’m weary every time I hear someone decide to switch to it exclusively."

Josh is my friend. He is cool and super respected.

Revision history for this message
rejon (rejon) wrote :

more info about data serialization, which is basically a complete hack of a way to add non-thinking to database design:

http://php.net/manual/en/function.serialize.php

Revision history for this message
nickybourque (nickybourque) wrote : Re: [Bug 689904] Re: replace serialized data in aiki configs

I suppose it depends. There are a handful of instances where it is
advantageous to store datastructures as blobs, but I don't think that
PHP has something like Perl's Storable. Regardless, it's very resource
intensive, and not a very good way to go in all but that limited set
of cases.

Why not just store config data in files?

On Mon, Dec 13, 2010 at 2:20 PM, rejon <email address hidden> wrote:
> more info about data serialization, which is basically a complete hack
> of a way to add non-thinking to database design:
>
> http://php.net/manual/en/function.serialize.php
>
> --
> You received this bug notification because you are a member of Aiki
> Framework Developers, which is subscribed to aikiframework.
> https://bugs.launchpad.net/bugs/689904
>
> Title:
>  replace serialized data in aiki configs
>
> Status in Aiki Framework:
>  Confirmed
> Status in openclipart:
>  Confirmed
> Status in PPL:
>  New
> Status in Scale Journal:
>  Confirmed
>
> Bug description:
>  Serialized data is evil! its inefficient and much better to just use a proper data type IMO. Since we rely so heavily on database and needing mysql, we should be super clean about ONLY using sql IMO.
>
> I changed on config and borked scale! So, I had to fire up a stupid commandline client and enter this:
>
> update aiki_config SET config_data='a:8:{s:4:"site";s:7:"default";s:3:"url";s:24:"http://scalejournal.org/";s:13:"default_chmod";s:4:"0775";s:11:"pretty_urls";s:1:"1";s:16:"default_language";s:7:"english";s:19:"default_time_format";s:9:"d - m - Y";s:8:"site_dir";s:3:"ltr";s:19:"language_short_name";s:2:"en";}' WHERE config_id=1 AND config_type='global_settings';
>
> That is insane because I had to hand edit and count the characters of the string.  Databases are used to store data, not have a data structure inside a storage system.
>
> This is a high necessary fix.
>
> If anything, we should provide easy access to creating proper fields on the db.
>
>
>

Revision history for this message
rejon (rejon) wrote :

better to store in DB, config files should be a backup option...even with
status.net, moved all configs in the db, but config file is a backup...

thanks for opinion nicky!

On Mon, Dec 13, 2010 at 2:34 PM, nickybourque <email address hidden>wrote:

> I suppose it depends. There are a handful of instances where it is
> advantageous to store datastructures as blobs, but I don't think that
> PHP has something like Perl's Storable. Regardless, it's very resource
> intensive, and not a very good way to go in all but that limited set
> of cases.
>
> Why not just store config data in files?
>
>
>
>
> On Mon, Dec 13, 2010 at 2:20 PM, rejon <email address hidden> wrote:
> > more info about data serialization, which is basically a complete hack
> > of a way to add non-thinking to database design:
> >
> > http://php.net/manual/en/function.serialize.php
> >
> > --
> > You received this bug notification because you are a member of Aiki
> > Framework Developers, which is subscribed to aikiframework.
> > https://bugs.launchpad.net/bugs/689904
> >
> > Title:
> > replace serialized data in aiki configs
> >
> > Status in Aiki Framework:
> > Confirmed
> > Status in openclipart:
> > Confirmed
> > Status in PPL:
> > New
> > Status in Scale Journal:
> > Confirmed
> >
> > Bug description:
> > Serialized data is evil! its inefficient and much better to just use a
> proper data type IMO. Since we rely so heavily on database and needing
> mysql, we should be super clean about ONLY using sql IMO.
> >
> > I changed on config and borked scale! So, I had to fire up a stupid
> commandline client and enter this:
> >
> > update aiki_config SET
> config_data='a:8:{s:4:"site";s:7:"default";s:3:"url";s:24:"
> http://scalejournal.org/";s:13:"default_chmod";s:4:"0775";s:11:"pretty_urls";s:1:"1";s:16:"default_language";s:7:"english";s:19:"default_time_format";s:9:"d
> - m - Y";s:8:"site_dir";s:3:"ltr";s:19:"language_short_name";s:2:"en";}'
> WHERE config_id=1 AND config_type='global_settings';
> >
> > That is insane because I had to hand edit and count the characters of the
> string. Databases are used to store data, not have a data structure inside
> a storage system.
> >
> > This is a high necessary fix.
> >
> > If anything, we should provide easy access to creating proper fields on
> the db.
> >
> >
> >
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/689904
>
> Title:
> replace serialized data in aiki configs
>

--
Jon Phillips
http://rejon.org/
http://fabricatorz.com/
chat/skype: kidproto | irc: rejon
+1.415.830.3884 (sf/global)
+86.187.1003.9974 (china)

+65.8330.5807 (singapore)

rejon (rejon)
Changed in ppl:
milestone: 0.2 → 0.3
Revision history for this message
rejon (rejon) wrote :

moving back work on this...

Changed in aikiframework:
milestone: 0.8 → 0.9
Revision history for this message
rejon (rejon) wrote :

hmmm...not sure about this now...hahahha

Changed in scalejournal:
milestone: 2010.12 → 2011.01
rejon (rejon)
Changed in ppl:
status: New → Confirmed
Revision history for this message
rejon (rejon) wrote :

we have bigger fish to fry.

Changed in ppl:
status: Confirmed → Invalid
Changed in aikiframework:
status: Confirmed → Invalid
Changed in openclipart:
status: Confirmed → Won't Fix
Changed in scalejournal:
status: Confirmed → Won't Fix
Changed in aikiframework:
status: Invalid → Won't Fix
Changed in ppl:
status: Invalid → Won't Fix
rejon (rejon)
Changed in aikiframework:
milestone: 0.9 → 0.8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.