I have experience with relational databases where atomicity and normalization are fundamental principles.
Do these principles also apply in a NoSQL environment?
Look at the following ways of representing a string in different languages (in a MongoDB notation):
{
'name': 'label_hello',
'en' : 'hello world!',
'de' : 'hallo welt!',
'es' : 'hola mundo!'
}
or
{
'name' : 'label_hello',
'values': {
'en' : 'hello world!',
'de' : 'hallo welt!',
'es' : 'hola mundo!'
}
}
vs. the more atomic variant:
{
'name' : 'label_hello',
'lang' : 'en',
'value': 'hello world!'
}
{
'name' : 'label_hello',
'lang' : 'de',
'value': 'hallo welt!'
}
{
'name' : 'label_hello',
'lang' : 'es',
'value': 'hola mundo!'
}
Which of these designs would be the most optimal in a NoSQL world?
Update:
To clarify my question further:
I’d like to know/understand stuff like: Which of these variants will be faster to seek, easier to update, increase hits, which can be indexed more intelligently?
I’m new to NoSQL, but based on my experience with such utility like Redis I can suggest, that for indexing the last variant would be best. Second is compact so it’s mostly the developer choise. Not all the time everything can be in atomicity and normalization frame, sometimes it should be beyond.