This is a tech test for using redis as a first layer data store that persists to a sql database. That way data that is constantly accessed, is able to be gotten quickly from Redis, but, old, not often accessed data gets pushed down to the myqsl layer. The technology here will be used in private projects. Also I wanted to try optimizing UUID's for use in mysql, as I have heard bad things about it, but want to try for myself.
- compactedUUID - this is a UUID that is reordered to be semi sequential and has the -'s removed
- expandedUUID - UUID in standard format
- all uuids are generated by our custom uuid helper.
- this helper takes a standard v1 uuid, and re arranges it os it will be semi sequential. This allows for faster mysql selects and inserts.
- The helper also compacts the uuid by removing unnecessary dashes.
- All uuid to be placed into redis WILL be compacted as described above.
- All UUIDs will be stored in a binary(16), in its unhexed form.
- example given compacted hex "id"
var sqlFriendlyID = new Buffer(ic, 'hex')
or INSERT INTO sometable (uuid) values (unhex("11d8eebc58e0a7d796690800200c9a66"))