3 ms·
I worked significantly in both Django and Rails, and I found the most magical part of rails is its ORM (ActiveRecord). I find both SQLAlchemy and DjangoORM both
by czhu12 2y ago
I worked significantly in both Django and Rails, and I found the most magical part of rails is its ORM (ActiveRecord). I find both SQLAlchemy and DjangoORM both more awkward and less natural to use, both for the query side and the relationship definition side.
Once the data is loaded into memory, everything else is just syntax.
At this point, I only reach for python as a web application if I need to build something that has AI / ML features. Rails apps I've built in the past that needed to call a local model resulted in having to create a python inference microservice, which kinda sucks.
- RangerScience 2y agoFYI, there’s a few projects out there for interoperability between Ruby and Python - stuff like putting one language in another. Also, Jupyter and Zeppelin notebooks allow for interoperability, although I don’t know how. (Oh, lastly, if there’s a JVM implementation of Python you could probably use alongside JRuby)
- dlx 2y agoAny recommended ones? Like the parent, I have to reach for Python for AI / ML work and would love to use Rails as the web frontend instead of Django.
- RangerScience 2y agoFor that, I’d just use Rails, and the connect AI/ML tools over an api or (riskier) direct to the DB. The stuff I looked at ages ago was for literally embedding Python code in Ruby code. I never used any of it either, so I don’t have any recommendations. Edit: Actually, rather than have Python connect to the Rails DB, have Rails also connect to the Python DB (note that this can be on the same db server, etc). Rails can then handle all the “I’m a product” stuff (user accounts, etc) and then read the Python data for the rest. Would that work?