Some opensource language don't have all the driver for all the database like memcache etc.So I want to write a driver for them.But I don't know how to do it.Where can I start?
A few ways to do this.
Use the language's foreign function interface to wrap an existing driver. This is usually the quickest route, but the resulting API may be clumsy or unnatural, and it will be hard to take advantage of language features.
Read the memcached protocol spec and write the driver. This works well for simple protocols and allows you to write drivers that use all of the features of the language (such as asynchronous IO, for example). However, this can be a lot of work if the protocol is not simple.
Port an existing driver to the target language. This works well if there is an existing driver for a similar language (e.g., Java and C# are similar).
I ranked these techniques in rough order of how common they are. Sometimes, as a language matures and its community grows, FFI libraries (#1) get replaced by native libraries (#2).