[wp-hackers] Why not json or xml instead of serialised data in DB

Otto otto at ottodestruct.com
Tue Jun 28 03:42:15 UTC 2011


The json data format doesn't support all the same formats as PHP data
can be. Javascript has limitations on variable names, for example.
Also objects don't retain all the information when you put them in
json. Things like that. PHP Serialization makes more sense if you're
going to be processing the data in PHP. JSON serialization only really
makes sense to send data to a browser to be used by javascript code.

As for changing the data directly, if you have to do that, then kinda
you're doing it wrong to start with, really. If you want to mess with
the data, mess with it in PHP instead of directly.

-Otto



On Mon, Jun 27, 2011 at 9:26 PM, Deepak Mittal <dpac.mittal2 at gmail.com> wrote:
> Just saw a post regarding how to move your domain on wp-hackers, and saw the
> issue of serialised data. I knew it from before but just thought it'd be
> extremely benefitial if wordpress used json or xml (json in particular).
>
> Although, I know it just takes one function to deserialise an array, same
> level of simplicity can be introduced for a json file as well. I'm proposing
> this because there are a lot of issues with serialised data in DB. For one
> if there is just a change of single byte, the data goes corrupt. This
> creates a lot of unneeded trouble for non-technical users.
>
> I'm sure I've missed some points as to why wordpress isn't using json and
> I'm sure the developers must've already given a thought about it. Can
> someone enlighten me?
>
> --
> Regards,
> Deepak Mittal,
> Twitter - @dpacmittal
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list