Hacker News new | ask | show | jobs
by el33th4xx0r 4038 days ago
Surprisingly, they uses mysql (instead of current hype k/v store) to map hostname and fileserver.
1 comments

MySQL is actually a really good key value store!

Here's the schema we use for the routing information:

    CREATE TABLE `pages_routes` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `user_id` int(11) NOT NULL,
      `host` varchar(255) NOT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `index_pages_routes_on_user_id` (`user_id`)
    );
Since we use MySQL for everything else, we decided it made the most sense to keep this routing data here rather than introducing a new database.
> Since we use MySQL for everything else, we decided it made the most sense to keep this routing data here rather than introducing a new database.

Very smart. "Perfection is Achieved Not When There Is Nothing More to Add, But When There Is Nothing Left to Take Away"

Do you run database management software, like severalnines clustercontrol, to manage your MySQL instances?
I was surprised the lookup takes just 3ms. Is Lua pooling the db connections?