3 ms·
Thanks a lot for your work! We recently switched to FastAPI from Django rest framework at Etebase[1] and it's been an absolute pleasure! P.S, if anyone is inte
by tasn 6y ago
Thanks a lot for your work! We recently switched to FastAPI from Django rest framework at Etebase[1] and it's been an absolute pleasure!
P.S, if anyone is interested, it took a bit of hacking, but we managed to get two unusual things working:
1. Use MsgPack instead of JSON. It works great and wasn't too much of an effort (the existing libraries are done wrong and don't work well).
2. Use the Django ORM with FastAPI. This was quite hard to do and quite manual as the Django ORM assumes the rest of the Django stack is in use.
Etebase is open source[2], so you can just check out how it's done if you are interested. I'm also happy to help if anyone has questions.
I really hope we get a good async ORM soon. I'm currently using SQLAlchemy 1.4b1 in a side project, though the typing (and mypy plugin) are unfortunately not there.
[1] https://www.etebase.com https://www.etebase.com
[2] https://github.com/etesync/server/ https://github.com/etesync/server/
- tiangolo 6y agoThat's very cool!
- leadingthenet 6y agoTortoiseORM is quite similar to the Django ORM, but it's pretty early days, especially with the migrations. Might be a good fit for you guys, though.
- tasn 6y agoYeah, I took a look at it but decided against betting on another new tech, especially in such a sensitive area where there are so many things that can go wrong!
- ben9 6y agopyDal has been around for ages. Wonder if you have seen it?
- ryanisnan 6y agoI have had the same challenge with other python ORMs. I would love it if the django ORM were separated from the django project itself. That would be a hugely positive thing for the industry.
- wp381640 6y agoSame experience. Just had a new project a month ago and we decided to stick to the tried and tested sqlalchemy + alembic after spending a few days looking at the new crop
- bkovacev 6y agoWas there any performance gain when you guys switched to MsgPack?
- tasn 6y agoWe didn't do it because of performance, we did it because of size. We deal almost entirely with encrypted data which means binary blobs. Msgpack lets us send binary data directly without the base64 overhead.