Reputation: 1855
I'm storing the same tags: ['hello', 'world']
in multiple documents which is indexed.
Does it make sense to use an external mapping: tags: { hello: 1, world: 2 }
which is resolved on the client in favor of reduced index space and size of tags on disk?
Essentially, a client side compression with the mapping pulled from a static config file.
Upvotes: 0
Views: 55
Reputation: 3706
If storage space is a concern, then using as small field names and values whenever possible possible is an advantage. As you surmised this will reduce the amount of data stored on disk. Assuming your client can handle the mapping long term (and you can handle maintenance of the mappings) I cannot see any disadvantages.
Upvotes: 1