120 points by johnrambo 6 months ago flag hide 17 comments
dhalbert 6 months ago next
Awesome work, I've been looking for a reason to dive deeper into Rust and this is the perfect motivation! I am curious if you have any thoughts on how to scale this for large userbases?
craigstuntz 6 months ago next
I saw this project a few days back, its performance is amazing because Rust! One suggestion is to consider adding a web-based admin UI for managing songs and users. You could use a client-side framework like Svelte or Alpine.js to help build the frontend more smoothly.
dhalbert 6 months ago next
Thank you for the suggestion! I will definitely look into both Svelte and Alpine.js. This would allow users to manage their profiles and playlists. I'm curious Craig, what would be your recommended route for connecting the new front-end with the existing back-end?
soyers 6 months ago next
@dhalbert A GraphQL subscription could be an excellent choice. This would enable the clients to define which set of data they would like to update in real-time without needing to build unnecessary endpoints.
soyers 6 months ago next
Thanks for suggesting GraphQL subscription. At some point, I would like to investigate Postgraphile's support for it. It could potentially save time on implementation.
dylantwo 6 months ago prev next
The Rust and WebAssembly roadblocks sound intimidating but, the project's success does appear to outshine the complications. I will begin learning and perhaps build a simple app first to better understand the ecosystem.
dhalbert 6 months ago next
One more piece of advice I'd like to add, to get the most out of the Rust ecosystem, consider learning its popular libraries and frameworks (like Tide, warp, and gotham). This will allow you to integrate better and more rapidly.
craigstuntz 6 months ago next
Excellent advice! The first thing I worked on, after the initial implementation, was learning the ecosystem and getting involved with the community. It contributed immensely to my overall experience and skill set.
postmodern 6 months ago prev next
Some food for thought in terms of scalability, we've been using GCP's load balancers to successfully distribute requests coming from mobile devices running our app. This has greatly helped reduce latency and manage sudden traffic surges. I wonder if you've considered similar solutions.
craigstuntz 6 months ago next
@soyers, No worries, that's why Hacker News exists! User traffic can become hard to predict, so it's great that you're putting together a strategy. I found load balancers and auto-scaling on GCP and AWS to be quite reliable.
aghauri 6 months ago next
GraphQL is definitely a solid option. Hashed over something similar when we first put together our data pipeline for the streaming service.
aghauri 6 months ago prev next
In terms of scaling, I found that serverless functions are perfect for distributing and auto-scaling tasks, especially if you're targeting a global userbase. We use Google Cloud Functions and AWS Lambda with success and I'm sure your implementation is no different.
dylantwo 6 months ago next
Thank you for sharing the success stories. That relieves the anxiety surrounding the implementation. I will make a more conscious effort to learn more Rust-related tooling.
dylantwo 6 months ago prev next
I'm very intrigued, but the idea of using Rust is scaring me a bit. I have no experience with it but have heard a lot about the learning curve. Are there guides or tutorials you recommend for learning Rust and WebAssembly?
soyers 6 months ago next
Wow, the use of GCP load balancers is clever indeed! Thanks for the excellent advice, I will certainly add it to the roadmap. So far, the userbase has been manageable, but I am planning for heavier usage starting later this year.
postmodern 6 months ago next
As a side note, I'd love to share that we've found the Rust community to be quite welcoming. If you have any struggles, the Rust Discord, Rust sub-reddit, and forums would be great for seeking help and obtaining resources when learning Rust.
dhalbert 6 months ago next
I agree, the community is amazing! That feeling when you contribute back to Open Source, even if it's a single bug or fix, is immensely fulfilling. 😊