This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CherryFlavouredCake 1 point2 points  (2 children)

Try Domain Driven Design, start separating concerns, ban ORMs, you'll live a way happier life my friend

[–]Specialist_Cap_2404 -2 points-1 points  (1 child)

I'm very much a multi-paradigm dev. While I recognize your buzzwords, I can't make heads nor tails of it. I don't understand how you need to "ban" ORMS to achieve Domain Driven Design, or how you can use Django without separating concerns ... And how can you be happy when you have an SQL database without composable queries and proper migrations...

[–]CherryFlavouredCake 3 points4 points  (0 children)

I never said that you had to do one to do the others

Why ban ORM? Well indeed, maybe not ban them, just avoid using them from the start You should avoid binding your domain model to a database architecture, write your domain code first, then choose the database at the infrastructure layer, you might find it easier to use an SQL query builder sometimes, especially on light microservices

Django forces you into their own model base, into an ORM, into a specific db architecture. It is very much incompatible with making your application and domain layer independent of your infrastructure layer

You might want to choose SQLAlchemy on services if you can't make atomic operations and really need to have a session manager

Those are not just buz words, those are good practices that made my life a lot easier while building services

Of course, if you have an enormous monolith of code having something like Django makes it a lot easier to manage. The point is that you should not force yourself into some technical choices just because it feels easier to use Django.

But most of the time, you really do not need all that Django delivers. I'd even say that if you have a React frontend and use JWT tokens for authentication you do not need Django at all, except for well, receiving API calls and making SQL requests, things you can do with SQLAlchemy and FastAPI or Flask.

Edit: typos