Should we use Rust?
I'm experimenting with using Rust here. I'd be most curious how this might affect contributors. Would you be more or less likely to contribute if GlitchTip was written primarily in Rust?
Advantages
- It's fun to learn new things and the vast bulk of GlitchTip coding is unpaid.
- More performant, uses almost no system resources at all. This is important because of GlitchTip's free offering, we must keep costs down.
- Very fast response times
- Allows for an all-in-on app. Rust and tokio have good async support. We want to run slow tasks after a web request or run scheduled jobs. tokio makes this easy and it's not possible at all with Django without using celery or hacky/abandoned async implementations.
- Types can compliment unit tests, better than Python type hinting
- Opportunity to rethink parts of GlitchTip such as event ingest
- Marketing potential as Rust itself is very popular.
Disadvantages
- I find I can write Django code maybe 3 times faster than Rust/Diesel/etc
- Diesel/seaorm are immature, django ORM has limitations but it far ahead currently
- Lack of web ecosystem, lacks:
- django admin
- django-allauth
- testing framework with database support
- production ready web server (though it may be so performant that it's not important)
- Limited database migrations
- DIY for basic tooling like how to run celery, run migrations, etc
- Would delay new features. Would always be tempting to say let's fix this only in the Rust version that isn't generally available yet.
Potential strategies
- Replace celery first with rusty celery
- Run both axum and django web servers, keep Django fully functional for some period of time
- PyO3 - this is a very conventional approach but I'm not sure it makes sense for us. Our goal is not to optimize a few critical code paths, it's to make the server easier and less resource intensive to run.
Edited by David Burke