?

Log in

No account? Create an account

Drizzle, Google Protocol Buffers, Low Hanging Fruit

« previous entry | next entry »
Aug. 12th, 2008 | 01:09 am

We have been looking for a new standard method for serializing objects from the server. Schemas, Replication Events, Tables, etc... all for one reason or another have to be serialized at some juncture at the moment. Each type has its own method/language which makes it a bit of a pain to deal with in the server.

Worse?

Few of the formats are upgradable. You end up with all sorts of incompatibilities that over time have become a real PIA to deal with.

Introducing Google's Protocol Buffers:
http://code.google.com/apis/protocolbuffers/

In short, this buys us an upgradable format and a lot less code. It also makes it much simple to write trivial little tools to pull apart objects from the server.

I pushed the first bit of this into Drizzle last night, and picked a low hanging piece of fruit, the schema, to do first:

message Schema {
   required string name = 1;
   optional string characterset = 2;
   optional string collation = 3;
}


The above was all I needed for schemas. Now out db.opt files can be upgraded as time moves on without us having to worry about the internal formats. I even wrote a 14 line piece of C++ code that allowed me to dump the files :)

It was only 14 lines because I did it in C++, I could have done it in fewer with Python :)

If you are interested in something a bit more advanced jump on the mailing list (https://launchpad.net/~drizzle-discuss/), and comment on this:
http://drizzle.wikia.com/wiki/Table_Proto_Definition

That is the definition we are putting together for describing tables (which will give us the ability to ditch FRM and move to a discovery system).

Link | Leave a comment |

Comments {2}

Andy Lester

(no subject)

from: petdance
date: Aug. 12th, 2008 03:20 pm (UTC)
Link

It was only 14 lines because I did it in C++, I could have done it in fewer with Python :)

If you'd done it in Perl, you'd only have had to wiggle your noise and blink hard.

Reply | Thread

Brian "Krow" Aker

(no subject)

from: krow
date: Aug. 12th, 2008 03:34 pm (UTC)
Link

We could do it in 1/3rd of the lines of code and then submit it to a perl obfuscate contest :)

Reply | Parent | Thread