mark
mark

Reputation: 62886

Using hsqldb as a key-value store

I would like to use hsqldb as a simple key-value store, where both the key and the value are strings. The value would be a JSON of some data, say no more than 10K in size.

The type of the value column is LONGVARCHAR.

I would like to know whether this type is suitable for this purpose.

P.S.

A bit of background. We wanted to use MongoDB or CouchDB, but the latest MongoDB does not support Windows XP and the latest CouchDB does not support Windows 32 bits, both of which is a requirement. Using a DB like Cassandra seems like an enormous overkill in our case.

Upvotes: 1

Views: 919

Answers (1)

fredt
fredt

Reputation: 24382

If the values are already in the UTF-8 or other 8 bit encoding form, you can use BLOB or VARBINARY. Otherwise, use CLOB or VARCHAR for Unicode characters. Both forms are suitable for up to 10K values. Note LONGVARCHAR is simply a long VARCHAR.

If speed of access is essential, you can test with both types and decide which one is the best for your data. The same access API can be used for BLOB/VARBINARY or CLOB/VARCHAR when the values are relatively small (10k).

Upvotes: 1

Related Questions