CREATE TABLE IF NOT EXISTS `kbest_daemons` (
   `id` varchar(50) NOT NULL COMMENT 'ip:port',
   `ready` tinyint(1) NOT NULL,
   PRIMARY KEY (`id`)
) ENGINE =InnoDB DEFAULT CHARSET=utf8;

Tabele na żądania:

CREATE TABLE IF NOT EXISTS `kbest_requests` (
   `request_id` bigint(20) NOT NULL auto_increment,
   `datetime` datetime NOT NULL,
   `user_id` int NOT NULL,
   `ip` varchar(15) NOT NULL,
   PRIMARY KEY  (`request_id`)
) ENGINE =InnoDB  DEFAULT CHARSET=utf8;

Tabele na słowa zgłoszone w jednym żądaniu:

CREATE TABLE IF NOT EXISTS `kbest_requests_words` (
   `request_word_id` bigint(20) NOT NULL auto_increment,
   `request_id` bigint(20) NOT NULL,
   `state` enum('QUEUED','READY','DUMPED','PROCESSING') NOT NULL,
   `word` varchar(15) NOT NULL,    
   `matrix_id` int NOT NULL,
   `k` int NOT NULL DEFAULT 20,
   PRIMARY KEY  (`request_word_id`),
   FOREIGN KEY (`request_id`) REFERENCES kbest_requests (request_id) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE =InnoDB  DEFAULT CHARSET=utf8;

Tabela na wyniki:

CREATE TABLE IF NOT EXISTS `kbest_results` (
   `request_word_id` bigint(20) NOT NULL,
   `kbest` longblob NOT NULL COMMENT 'slowo;sim;slowo;sim...' ,
   PRIMARY KEY  (`request_word_id`),
   FOREIGN KEY (`request_word_id`) REFERENCES kbest_requests_words (request_word_id) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE =InnoDB  DEFAULT CHARSET=utf8;