[Maria-discuss] NoSQL at mysql client
Hi guys, i was reading some time ago about memcache (i use it for a long time ~5years or more) and the handler socket plugin Why we don't implement it at mariadb client? instead of a second library to add nosql, why not implement a built in lib? for example... (pseudo functions...) mysql_connect ... (connect to database and have permission handling...) mysql_select_db ... select the schema being used mysql_query ... execute a query command (SQL QUERIES) mysql_fetch ... get a row mysql_num_rows .. get number of rows now the nosql... mariadb_handler_socket_openindex( handler socket parameters ) mariadb_handler_socket_query mariadb_handler_socket_fetch mariadb_handler_socket_close mariadb_memcache_get mariadb_memcache_set ... this make mariadb a sql/nonsql database with a single user/permission schema, and a nice language set (SQL, handler socket, memcache, redis, drizzle, hadoop, mongodb or others...) in this case we can use the mysql protocol, but instead of sending a QUERY command, we send a "MARIADB" command, and a new parameter telling what mariadb command it is, this can be used with mysql/mariadb/percona, when used with others database probably the database will report a wrong command message but we can contact mysql to reserve a command id to "others uses", and have compatibility with any mysql fork... but the point is... instead of many connections (3-> mariadb, handler socket write, handler socket read, or 2 -> mariadb, memcached) we have only one 1-> mariadb comments are wellcome, any idea why not implement this instead of many different protocol libs? -- Roberto Spadim
Hi, Roberto! On Aug 16, Roberto Spadim wrote:
Hi guys, i was reading some time ago about memcache (i use it for a long time ~5years or more) and the handler socket plugin Why we don't implement it at mariadb client? instead of a second library to add nosql, why not implement a built in lib? for example...
(pseudo functions...) mysql_connect ... (connect to database and have permission handling...) mysql_select_db ... select the schema being used mysql_query ... execute a query command (SQL QUERIES) mysql_fetch ... get a row mysql_num_rows .. get number of rows
now the nosql... mariadb_handler_socket_openindex( handler socket parameters ) mariadb_handler_socket_query mariadb_handler_socket_fetch mariadb_handler_socket_close
mariadb_memcache_get mariadb_memcache_set ...
this make mariadb a sql/nonsql database with a single user/permission schema, and a nice language set (SQL, handler socket, memcache, redis, drizzle, hadoop, mongodb or others...)
For a single user/permission scema, the connection should go to the server, it cannot be done in the client.
but the point is... instead of many connections (3-> mariadb, handler socket write, handler socket read, or 2 -> mariadb, memcached) we have only one 1-> mariadb
No, if you do it in the client, as you want to, it still will be many connections. libmysqlclient -> server, libmysqlclient -> memcached, etc.
comments are wellcome, any idea why not implement this instead of many different protocol libs?
I don't see the point. Regards, Sergei
hi sergei, i was thinking about use only one tcp/ip connection (the mysql client connection to server), and not many connections... but to do this job using the mysql protocol, we should add a new command, instead of send a "COM_QUERY" command to server, send a "COM_EXTERNAL" (or may be "COM_PLUGIN") command + "any other nosql command", to prevent incompatibility with others mysql servers, to avoid add more plugin tcp/ip sockets... for example handler socket add more 2 tcp/ports... it's a relative problem since i have some firewall rules specific to mysql, and i need to add the same rules to handler socket (ok it's not a problem, but add more work to dba/network admins) here: http://dev.mysql.com/doc/internals/en/command-phase.html i don't see a "for external use" or "plugin specific" command, maybe we could add it what i want is... one single daemon, on one single port (The mysql/mariadb daemon) with user/password, auth plugins, security/ssl and everything that mysql/mariadb already, and add the possibility of send others "no mysql" commands to plugins via this daemon yes, we will add a security problem... a bad user could create a plugin to add a http proxy, or anything else he want... but there's good and bad guys in the world. just evict the bad ones and dba will work fine, the already evict them selecting what plugin should/shouldn't be used well i don't know if you understand my idea this add a very nice piece of cake to plugin developers... they can use the mysql network api, instead of learning how to use unix sockets, tcp socket, windows shraed memory, and many protocols that mysql have, they will only learn how to use mysql protocol api =D !!! that's very very good! we will not need a second socket_select, or a second libevent to know if a tcp/ip port have new data, we will use only the mysql thread pool, or mysql lib event or whatever mysql/mariadb use to handle network packets...
Hi i was thinking again... the main point is add a raw send/receive command over mysql protocol, at client side we will send memcache protocol, and at server side we will receive and send the packets to plugin With more time plugin could return a result set (like a Query command), or raw data via raw send/receive over mysql protocol This solve many problems :) ok add a overhead but at other side we have a more secure protocol (main problem of handler socket and memcached and others nonsql servers), and we will have a nice thread pool or other connect handler... :) We should add more status to processlist to allow a better understand about what plugin is doing... maybe a new field (Plugin_status) What you think Em 17/08/2013 11:52, "Sergei Golubchik" <serg@mariadb.org> escreveu:
Hi, Roberto!
On Aug 16, Roberto Spadim wrote:
Hi guys, i was reading some time ago about memcache (i use it for a long time ~5years or more) and the handler socket plugin Why we don't implement it at mariadb client? instead of a second library to add nosql, why not implement a built in lib? for example...
(pseudo functions...) mysql_connect ... (connect to database and have permission handling...) mysql_select_db ... select the schema being used mysql_query ... execute a query command (SQL QUERIES) mysql_fetch ... get a row mysql_num_rows .. get number of rows
now the nosql... mariadb_handler_socket_openindex( handler socket parameters ) mariadb_handler_socket_query mariadb_handler_socket_fetch mariadb_handler_socket_close
mariadb_memcache_get mariadb_memcache_set ...
this make mariadb a sql/nonsql database with a single user/permission schema, and a nice language set (SQL, handler socket, memcache, redis, drizzle, hadoop, mongodb or others...)
For a single user/permission scema, the connection should go to the server, it cannot be done in the client.
but the point is... instead of many connections (3-> mariadb, handler socket write, handler socket read, or 2 -> mariadb, memcached) we have only one 1-> mariadb
No, if you do it in the client, as you want to, it still will be many connections. libmysqlclient -> server, libmysqlclient -> memcached, etc.
comments are wellcome, any idea why not implement this instead of many different protocol libs?
I don't see the point.
Regards, Sergei
Hi Sergei/Developers/Users i put a new MDEV =] to explain it check if you can understand (it's in 10.1.0 since i clicked in clone, sorry) https://mariadb.atlassian.net/browse/MDEV-4921 ideas are well come :)
participants (2)
-
Roberto Spadim
-
Sergei Golubchik