I read that the Name-Value-Pair Model in database design is an anti-pattern. Essentially you have a table with two columns. One column is called 'name' and the other column is called 'value'. Let's say you are managing AWS configuration for different regions. The database structure would be as so:
name value
aws.new_york.access_key jio4j54h
aws.new_york.site.user john
aws.new_york.site.pass eoiri4iiuh
aws.los_angeles.access_key tret55464
aws.los_angeles.site.user bob
aws.los_angeles.site.pass rtry45yrt
aws.new_york.access_key fgfhgf4fdg
aws.new_york.site.user edward
aws.new_york.site.pass 45gfhgfhgf
The only use is to retrieve configuration:
MyApp.config.get('aws.new_york.access_key')
The other solution is to use joins. This would remove duplication and allow for referential integrity. But it becomes cumbersome:
table_aws has_many table_states which has_many table_credentials which has columns access_key, user, pass. This indeeds remove duplication, but imagine the potential for increased number of nested joins.
Given my only use case, is the Name-Value-Pair Model model still an anti-pattern or would it be suitable?