by eberfreitas · 13y ago · 0 comments
> Moreover, the fact that Django makes most of the decisions about how the database will be structured just baffled me – why does Django know better than me what the database should look like?
If that is really true (I don't have any Django/Python experience) the simple answer is "It doesn't". In the long run, relying on the ORM to provide high scalability is not a sane choice and I'm pretty sure Django must be able to allow some flexibility on how tables and columns are defined according to your needs.The thing is that lately I'm finding myself unhappy with the idea of ORMs and how they handle things. When I see that a framework has a lot of dependency to some ORM, I get instantly unmotivated to learn more about it.
ORMs seem to be great if you are doing prototyping, but most of my analysis tools have to be built against existing datasets or ecosystems. I'm either shoehorning in two databases from two separate architectures together or at the very least working with one that is populated by another tool.
ORMs fall flat on their face in these circumstances, and I'm left with having to fight against it in cases where it may be tightly coupled.
One of the biggest problems I have had with a lot of the cool new frameworks is that they make basic assumptions about how they will use them.
up to a certain size, most ORMs will behave just fine! the bigger problem is when your mental model of how the ORM should be behaving for a certain data access pattern is thwarted by the actual implementation. This usually only happens when you notice a performance bottleneck around a semi-exotic query that you know to be trivial in sql or whatever.
it's also possible to put up performance abstractions between you and that ORM bottleneck, but often the experience and tradeoff sours most people. i don't blame them, but i agree that for most day-to-day cases, orms are pretty handy.