6 ms·
I've had relatively good success moving some microservices from Kotlin to Rust (mainly saving about 90% resident memory util). I picked up Actix recently, and s
by nevi-me 8y ago
I've had relatively good success moving some microservices from Kotlin to Rust (mainly saving about 90% resident memory util).
I picked up Actix recently, and so far I'm enjoying using it. If Rust library support for geospatial tools was as good as turf.js, I'd be able to move a lot more stuff into Rust.
- MrBuddyCasino 8y agoWhats your driver? Do you save enough server resources do make it worth it, or is it just a hobby project?
- nevi-me 8y agoI run a public transport website that includes a few mobile apps. I've broken it down into quite a few microservices, but the bulk of it runs on Node and JVM. I have a 64GB RAM, 12 core server, and the JVM services take up about 25% of resident RAM (ignoring Kafka and other Java stuff). I've wanted to learn Rust for a while, so I recently bit the bullet. I use gRPC everywhere (Dart/Flutter, Node, JVM, Python), so I decided to start by rewriting some small services in Rust using gRPC for comms. For now, I've taken a Java service that used 500MB at peak, to under 10MB RAM. I'm planning on eating into the big stuff over the coming months. It's not making money, so it's a "hobby" yes. Consulting's paying the bills so I don't mind at this point. EDIT: E.g. here's an url shortener gRPC server that runs on NodeJS, and a Rust client that can shorten urls and get results back. https://github.com/MovingGauteng/shorty https://github.com/MovingGauteng/shorty https://github.com/MovingGauteng/rust-grpc-shorty https://github.com/MovingGauteng/rust-grpc-shorty
- MrBuddyCasino 8y agoThanks, situation is similar for me - a 5€ Digital Ocean Droplet (1GB RAM) goes much farther with Rust services than JVM based ones. FYI: https://nevi.me/ https://nevi.me/ errors out with a 502.
- nevi-me 8y agoThanks, the Ghost service was down. The blog's back up. Regarding the RAM, I'll see how far I get with moving some services to Rust in the coming months, and what benefit I derive in the long run.
- rammy1234 8y agosame question, why moved from Kotlin to Rust all the way.
- nevi-me 8y agoTo supplement the other sibling question that I answered: It's a learning experience. Right now, I can't port everything to Rust, because each platform has its advantages. Rust is still missing a lot of libs that exist in NPM and Maven, so it makes it difficult. I've been exploring exposing some functions that exist in Java/Kotlin through gRPC (as everything runs on the same network anyways) until it's available on Rust. I hope to blog about my experiences in the coming days/weeks.
- weavie 8y agoOf the libs that are missing in Rust, which one would you find the most useful? I'm looking for project ideas to get stuck into.. :)
- nevi-me 8y agoIt's largely geospatial tools, which urschrei commented on above. Others are abstract, for example I use https://ignite.apache.org https://ignite.apache.org (I know I could use Redis), and that's one of the things tying me into the JVM. I use Apache Ignite as a distributed cache thingy.
- some_account 8y agoI really want something in rust that can read orc files from hdfs and write them to some other database using jdbc or odbc. It's difficult though. So many technologies there from the Java world :(
- lewisinc 8y agoCould you link to your blog, please? I'd like to read about that when you do end up writing about the experience.
- urschrei 8y agoTurf development is funded by Mapbox. If you need more Geo functionality than that provided by https://github.com/georust/rust-geo https://github.com/georust/rust-geo (I'm one of the developers), contributions are actively encouraged, and we're happy to mentor people. Alternatively, feel free to pay for some dev time if you need something specific (e.g. OpenCage paid to have their geocoder included in https://github.com/georust/rust-geocoding https://github.com/georust/rust-geocoding, dual-licensed as Apache / MIT).
- nevi-me 8y agoHi urschrei, I naively tried to port turf to Rust, but from my past experience [0] and flaky time commitment in the past; I thought it'd be too much to do alone. I've seen georust, and it's on my backlog. There's a few functions that I saw missing (that I actively use). With mentorship, I'd love to contribute them. I'll open some issues and introduce myself in the coming days. [0] https://github.com/nevi-me/turf-kotlin https://github.com/nevi-me/turf-kotlin
- joshlemer 8y agoHey by the way the link in the readme to the documentation is broken. It points here https://docs.rs/geo/0.9.1/geo/ https://docs.rs/geo/0.9.1/geo/
- ejanus 8y agoI would like to join so that I would be mentored . So, where do I start ?
- cies 8y ago> mainly saving about 90% resident memory The TechEmpower benchmarks do not care for mem usage and startup time. Maybe this has something to do with them doing JVM consulting? :)