Re: How to create a SQL engine like MySQL server

Stewart Smith <[email protected]> Thu, 29 Jan 2015 09:16:56 +1100
Newsgroups gmane.comp.db.mysql.devel
Message-ID <[email protected]>
harryxiyou <[email protected]> writes:
>> Your question is a bit ambiguous. Are you:
>>
>> a) Trying to write a new storage backend (StorageEngine) for MySQL?
>>
>>    If so, look at the EXAMPLE, ARCHIVE, CSV and InnoDB engines for
>>    HOWTO.
>>    Yes, the API is damn awful and has never been cleaned up.
>
> My current problem is to design/implement a SQL engine like MySQL
> server especially for its proxy so that my server side could be
> connected by standard MySQL client side. For the storage engine part,
> we have implemented portions. To be more exact, I am not sure how to
> implement a proxy to be connected by standard MySQL cilent (We need
> standard MySQL client protocol).
>
>>
>> b) Trying to write a database server that's a bit like MySQL (that
>> speaks the MySQL protocol)?
>>
>>    The MySQL protocol isn't that hard to implement yourself. Have a look
>>    at libdrizzle and libattachsql for liberally licensed implementations
>>    of client side (and some older libdrizzle versions, server side).
>>
>
> Yes, exactly, I wanna know how to design/implement light-weight MySQL
> server side proxy so that standard MySQL client could connect to it.
> It seems that libdrizzle and libattachsql are all MySQL client side,
> right?

Check out some older libdrizzle, it had some server side
support. There's some documentation there too. The protocol isn't *that*
tricky, you could probably work it out from looking at some sources or
other protocol documentation. Also, there's no *real* good reason to be
wire compatible, the MySQL protocol isn't that great for a number of
reasons. A simple wrapper around protobufs is probably vastly superior.

You should be able to expand libattachsql to support server side things,
Andrew is pretty awesome and would quite likely love patches.


-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals