My app uses an RDBMS (postgres w/ activerecord) to store and fetch text objects. Each text object can have any number of languages associated with it. So far I’ve been thinking of these language associations as tags in my head, much like blog posts can have any number of arbitrary tags. However, these language tags are not arbitrary, and are instead limited to a small set of about 30. In my app a user can request some text objects and supply a set of languages (say English, German, and French) and the app should go ahead and grab some text objects associated with ANY of those languages.
What’s the most effective approach/schema for associating languages with these text objects to make querying easy?
To make it easy to query you can create a view to avoid the constant joining.
Now query as if it were a single table: