Is Tortoise ORM Ready for Production Use?

July 29, 2025 7 answers
Asked by CuriousCat42
I'm exploring the possibility of using Tortoise ORM for my project because it seems easier to handle async database operations compared to SQLAlchemy. Plus, it has native support for FastAPI, which is a bonus. Has anyone actually used Tortoise ORM in a production environment? I'd love to hear your thoughts and experiences!

Answers

AsyncAdvocate
Honestly, I think SQLAlchemy isnโ€™t that complicated to test. You can easily reconfigure your sessionmaker to point to a new engine. If your engine isn't referenced directly in the app, youโ€™re golden! Alternatively, wrapping the engine in a container object for easier overrides is also an option.
Reply to this answer
ORM_Explorer
I've been using Tortoise ORM in a production environment for a couple of years now, primarily because SQLAlchemy was slow to implement async support. While the core features of Tortoise are pretty solid, the integration with FastAPI and Pydantic has its quirks, although it's not essential. Donโ€™t overlook the Tortoise migration tool; itโ€™s quite handy even if it lags behind Alembic.
Reply to this answer
DjangoHater88
What makes Tortoise ORM easier to test? Personally, I find Django's DB-connected testing annoying, but since I switched to Testcontainers, itโ€™s not so bad. SQLAlchemy seems to keep the domain cleaner and can often be tested without direct I/O, which is a huge plus.

CodeNinja77: Actually, Django does allow you to isolate tests from the database. You just gotta choose the right test class!

Reply to this answer
SkepticalCoder
From what Iโ€™ve seen, SQLAlchemy is pretty test-friendly. If you're having trouble, you might need to reevaluate your setup.
Reply to this answer
QuerySquirrel
If you're exploring options, give Piccolo ORM a look! Itโ€™s been my preference for most projects lately. Definitely worth checking out!

CritiqueMaster: I checked it out, but it feels like another ORM that doesnโ€™t align with Python basics. We really need to do better in the community!

Reply to this answer
TechieTom89
I didn't even know there were other ORMs besides SQLAlchemy! My team's been using SQLAlchemy and Alembic with solid test coverage, so Iโ€™m not quite sure what you mean by it being hard to test. We use PostgreSQL in a Docker container for our tests, which keeps things isolated and runs smoothly. Sure, some people really dislike ORMs, but honestly, SQLAlchemy is pretty battle-tested in professional scenarios. Just my two cents!

DevDude99: Sounds like a solid strategy! Iโ€™m curious if any specific libraries helped with your setup.

Reply to this answer
NewbieCoder_123
Just started looking into Tortoise. Seems interesting!
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions