-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite this project in Python #119
Comments
In the realm of Python, I have a strong preference for pretty standard, well-known tools, e.g. Django or Flask. That said API Star is looking kinda neat, especially for our use case (with a similarly nice documentation front page that gets auto-generated). |
As a side note, we have some serious performance/memory problems here: Doubtless there are things we could be doing slightly better in ActiveRecord’s ORM, but I have spent a fair amount of time on this over the last few months. I think Django’s ORM is a little lighter, but fundamentally, we probably need to avoid the ORM entirely for most of our list-based queries—particularly for pages. |
Are we logging slow queries, or if not, would that be worth doing? If we could drop some logs in an issue, might that be a domain where we could solicit external contributors without too much onboarding. Happy to reticket if it sounds like a decent approach |
We are, but it’s not a slow query—that's the point of the chart. All the time is being spent in Ruby. |
Oh! (Aw man, I am bad at chart-reading.) Wow, my brain just wasn't expecting to read that as ruby Hm. A little more niche, but maybe someone gets their kicks out of ruby/rails optimization? Or do you think it's marginal benefits, and the better convo is over changing languages? |
Heh, you can be forgiven; it’s not what you would expect to see (especially for how little work the Ruby code should be doing on those requests). Would love to have help/advice from someone who is an expert on that. I don’t know when we are going to get around to this rewrite, so an interim improvement is still worthwhile. And it’s always possible insights could carry over. |
Note: this performance stuff has largely been handled. What we need here is for someone to take a hard look at various Python tools that would be good to rewrite this in and do a clear writeup of the pros & cons (and ideally make a recommendation 😁). Some obvious ones to look at:
Some important considerations:
|
Reflecting on the first contact conversation between @Mr0grog and myself that led to the Rails/Python split, as I walked @jsnshrmn through the history that got us to this point, I think I overestimated my capacity to catch up on Rails, having last touched it in 2013 and in a volunteer capacity. Looking forward, I'm not sure how to correctly prioritize this -- surely at some point after our v0.0.2 Milestone -- but I'm certainly happy to help, and I think it is probably a worthwhile rewrite for the long-term health and maintainability of the project. |
I think it’s reasonably important and there are good ways to migrate (e.g. first rewrite some of the tests in Python, so we can use them against both implementations, then start writing parts in Python and proxy them through the Rails app (or vice-versa)). Either way, what we need first is for someone to take the time to do the research from the above comment. We should have a writeup here of each option and their pros, cons, and impact on transitioning. There’s no reason for someone not to take this and get started on it right away. 0.0.2 is pretty much entirely blocking on me. I have some basic analysis thoughts, but this is not good enough:
I don’t know if there are any good competitors out there to SQLAlchemy that are worth looking at. |
Unofficial sqlalchemy async support (pre-1.0, probably not a good idea, but seems to be the state of the art right now): https://github.com/CanopyTax/asyncpgsa |
Added to Django: 👍 Has Django Rest Framework which could potentially shortcut a lot of things for us (I’ve never used it, but have heard good things from former colleagues). |
My thoughts on django based on experience: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in seven days if no further activity occurs. If it should not be closed, please comment! Thank you for your contributions. |
Still gonna have to happen. Still looking at this issue with dread. |
Ran across the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in seven days if no further activity occurs. If it should not be closed, please comment! Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in seven days if no further activity occurs. If it should not be closed, please comment! Thank you for your contributions. |
Bringing this project back to life, but in a slightly different form: rather than porting this project as-is to Python, we should stop focusing on building an API. Instead, this should focus on:
Nobody is actually using the API externally, but maintaining this project as an API rather than a back-end keeps us constantly bending over backwards and doing a lot of extra work to maintain that possibility. Re-imagining the goals here makes me slightly less scared of this task, although I am definitely still worried about it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in seven days if no further activity occurs. If it should not be closed, please comment! Thank you for your contributions. |
This is not necessarily a high priority at current, but is here to make sure we budget time to do the work.
At this point, it is fairly clear that the decision to write this project in Ruby was a bad idea based on a incorrect understanding of EDGI’s situation (that legacy code written in Ruby needed to be supported, that those authors would stick around, that other contributors were comfortable with Ruby). There are approximately zero contributors (active or otherwise) to the Web Monitoring project as a whole (besides myself) who are comfortable working with Ruby, let alone experienced in Rails. Further, all other code in the associated projects (and in new experimental work submitted by others, e.g. edgi-govdata-archiving/web-monitoring#36) has been written in either Python or JavaScript, making this the odd technology out that makes understanding and working across the four software projects in web monitoring problematic.
This should probably be Python (3), both because the tools for a database-backed CRUD API like this one are generally more mature and because most of the other back-end stuff we have is also Python.
The text was updated successfully, but these errors were encountered: