re: What are ORMs and why should you use them? VIEW POST


I'd just like to add some other points about ORMs.

They're handy for smaller, simpler projects, but there are other cons to them that are seldom, if ever discussed at all.

If multiple applications rely on a single database, then who owns the source of truth for the schema/model? Each ORM application instance can quickly become out of sync with one another.

Additionally, databases have added some absolutely AMAZING features in recent years that most ORMs have yet to really exploit. Document store (such as JSON data), spatial data, graph relationships, recursive queries, system versioned data, expanded data types, read/write sharding, clustering/high-availability/fail-over, and more.

For reference, I'm personally not against ORMs. Quite the opposite, having written a SQL query generator that also has ORM functionality for PHP. Through that development process though, I realized I always needed more and more functionality, and quite enjoyed exploring these more powerful features.

My main goal with this comment is that I just want readers to also know that ORMs, while an awesome tool, especially to get started right away, hide a lot of the really awesome things that databases can do these days. Please always keep exploring! :)


Oh yeah, ORMs are by no means a silver bullet. Like you said, they are great for prototyping but they do need tend to lag behind in making use of the more powerful and advanced features of most databases.

They also tend to primarily target SQL databases, its rare that I've found an ORM library for NoSQL databases like Mongo.

Code of Conduct Report abuse