Some opinionated database frameworks have made a point of using pluralized names for database tables. I disagree with this opinion and will explain why.

A database table is regarded as a type (or class) by a variety of programming language frameworks. What that means is a type represents an entity, be it a visitor, a product, or an article. Concretely this means a table contains a collection of articles, and that’s where the plural path derives its logic. However, in code the thing you get from a given table is a singular thing. Thus an ‘article’ type should map to an ‘article’ table, that being the type it stores. It doesn’t store an ‘articles’ type.

By maintaining direct parity between the type ‘article’ and the table ‘article’, there is no morphology required to determine the name of a table for a thing, they are the same. This plays out badly for pluralization because plurals for many things are not so simple as adding an ‘s’ suffix, or worse, some plurals are the same as the singular. A long time ago I found a module in ActiveRecord (or a reference to it) of logic just to deal with the English language morphology of pluralization. While that was a tidy accomplishment, it seems like a horrible waste of time and effort for an opinion that yields questionable, or in my opinion negative, value.

I say negative value because the programmer in observing this pluralization has to keep track of how tables are named differently than the types being dealt with in the code. Maybe directly touching the database isn’t so frequent, but that makes a greater case for having it all be exactly the same.