This is a mirror of official site: http://jasper-net.blogspot.com/

Turn MySQL to NoSQL [HandlerSocket]

| Wednesday, January 19, 2011
Most of the scalable application on web use MYSQL+memcached as the back end for their applications. Recently some of them shifted to NOSQL for one of the biggest reason ‘performance’. Certainly, NOSQL performs better than MYSQL for simple queries and primary key look-ups.

Most of the database queries of web applications are simple and related to primary key lookups. So, it seems to be intelligent decision of migrating to NOSQL from MYSQL.


NOSQL on MYSQL- Is it possible?

Yoshinori Matsunobu recently launched a MySQL plug-in ‘HandlerSocket’ which implements protocol for MySQL. The plug-in allows applications to communicate directly with MySQL storage engines, without the overhead associated with using SQL. Operations such as parsing and optimizing queries, as well as table handling operations (opening, locking, unlocking, closing) are also included in this plug-in.

As a result, HandlerSocket can provide much better performance for applications that using normal SQL application protocols for primary key lookups.

How it Works?


Whenever a query is fired on a table in MySQL, MySQL servers upper layer parses the query. Then it opens a table for which query is fired. After performing operations on data table is closed and results are returned. So, for every single query MySQL Engine opens a new instance of table and closes it after performing operations.

Opening and closing of tables is very costly as it causes mutex contensions and hampers performance. The biggest difference here in Handlersocket is, it doesn’t open/close tables everytime. It reuses the open table connections.

Read more: Tutkiun!

Posted via email from .NET Info

0 comments: