Patrick Galbraith (capttofu) wrote,
  • Mood:

memcached Functions for Drizzle now in main tree!

What a great day! I see that the drizzle team has merged in my (and Padraig O'Sullivan's) memcached Functions for Drizzle (UDFs). I'm really glad to have this in drizzle now as it adds a means of interacting with memcached from within Drizzle. I have most functions from the MySQL branch implemented now as well. I'm extremely grateful to Padraig O'Sullivan for getting this project off the ground. I was a bit stuck with the new API and C++ when I first attempted these and he designed the class setup and had the major functions working which I then picked up and added more functions as well as tests. I was also glad to have the drizzle team add in my sleep() UDF which allowed me to test expirations in these memcached functions.

These functions have some similar, but very little code from the memcached Functions for MySQL. The new UDF API is completely different than MySQL's UDF API. You have to create a class for each function that is a derived item class. Gone are the function_init, funciton (value), function_deinit setup-- now the main logic is all implemented in value *method*.

These functions are really useful: You aren't tied to a particular client language. Say for instance you have an application that doesn't yet have a client to Drizzle (though, most languages are supported). This solves that problem in that the UDFs use libmemcached. You can also construct queries that use a table of IDs (fast lookup) to pull from memcached several items at once in an aggregate query which is really useful. You could effectively use drizzle as a relational organizer of data you have put into a memcached cloud.

I'll be continuing to add features from the MySQL memcached functions as well as add the work I've completed need to get released, which is utilizing Trond Norbye's great work with connection pooling, which Padraig and I will eventually want to use one of the C++ map classes to solve.

You can use these functions, as well as Drizzle by visiting:

https://code.launchpad.net/drizzle
Tags: drizzle, functions, memcached, mysql, udf
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic
  • 0 comments