Hacker News new | ask | show | jobs
by nevi-me 2947 days 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.
4 comments

Turf development is funded by Mapbox. If you need more Geo functionality than that provided by 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, dual-licensed as Apache / MIT).
Hi 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

Hey by the way the link in the readme to the documentation is broken. It points here https://docs.rs/geo/0.9.1/geo/
I would like to join so that I would be mentored . So, where do I start ?
> 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? :)

Whats your driver? Do you save enough server resources do make it worth it, or is it just a hobby project?
I 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/rust-grpc-shorty

Thanks, 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/ errors out with a 502.

Thanks, 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.

same question, why moved from Kotlin to Rust all the way.
To 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.

Of 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.. :)
It's largely geospatial tools, which urschrei commented on above. Others are abstract, for example I use 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.
I 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 :(
Could you link to your blog, please? I'd like to read about that when you do end up writing about the experience.
I assume its [0] as can be found in his profile. Too bad it is throwing an error right now.

[0] http://nevi.me

It is, I didn't see that it's down. Just finished writing my last exam, so I'll have time to get it back up and running