[Django]-When should HStoreField be used instead of JSONField?

21👍

If you need indexing, use jsonb if you’re on 9.4 or newer, otherwise hstore. There’s really no reason to prefer hstore over jsonb if both are available.

If you don’t need indexing and fast processing and you’re just storing and retrieving validated data, use plain json. Unlike the other two options this preserves duplicate keys, formatting, key ordering, etc.

Leave a comment