In order to start using mysql as your backing datastore you first need to create the database and tables. Default name for database is kvtstore, but you are free to use whatever, just reflect it in the jdbcUrl when accessing it later. You also need a user that is allowed SELECT, INSERT, UPDATE, DELETE on the tables.
CREATE TABLE keyvalue (
`primaryKey` varchar(255),
`type` varchar(255),
`data` longtext,
`time` varchar(255),
PRIMARY KEY (`primaryKey`, `type`),
INDEX `timeIndex` (`type`, `time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE indexvalue (
`indexName` varchar(255),
`type` varchar(255),
`value` varchar(255),
`primaryKey` varchar(255),
PRIMARY KEY (`primaryKey`, `type`, `indexName`),
INDEX `typeIndexValueIndex` (`type`, `indexName`, `value`),
INDEX `typePrimaryKeyIndex` (`type`, `primaryKey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Java code example to instantiate a key time value store on a mysql backend.
Serializer serializer = new JacksonSerializer();
Deserializer deserializer = new JacksonDeserializer();
TimeProvider timeProvider = new SystemTimeProvider();
TimeFormatter timeFormatter = new AlphabeticallySortableTimeFormatter();
MySQLKeyTimeValueStore(serializer, deserializer, timeProvider, timeFormatter, jdbcUrl, jdbcUser, jdbcPassword);
Spring user can get help with wiring, look into [Spring integration].