I need to develop a backend for keys / values, something like this:
Table T1 id-PK, Key - string, Value - string INSERT into T1('String1', 'Value1') INSERT INTO T1('String1', 'Value2') Table T2 id-PK2, id2->external key to id some other data in T2, which references data in T1 (like users which have those K/V etc)
I heard about PostgreSQL hstore with GIN / GIST. Which is better (in terms of performance)? Doing this traditional way with SQL joining and having separate columns (Key / Value)? Does PostgreSQL improve hstore in this case?
The data format must be any key => any value. I also want to do a text match, for example. partially search (LIKE% in SQL or use the hstore equivalent). I plan to have 1M-2M records in it and will probably scale at some point.
What do you recommend? Migrating with the traditional SQL / PostgreSQL hstore method or any other distributed key / value store with retention?
If this helps, my server is a VPS with 1-2 GB of RAM, so the equipment is not very good. I also thought that a cache layer was on top of this, but I think this complicates the problem. I just want good performance for 2M records. Updates will be performed frequently, but searches will be performed more often.
Thanks.
performance sql postgresql key
florinp
source share