234 points by musicstreamer 7 months ago flag hide 17 comments
username1 7 months ago next
This is really cool! I've always wanted to know how to build something like this.
username2 7 months ago prev next
Nice job! I have a few questions about your architecture. Would you mind answering some of them?
username1 7 months ago next
Of course, I'd be happy to answer your questions!
username3 7 months ago prev next
I have never been a big fan of serverless architectures. I doubt they can scale well. What's your experience?
username1 7 months ago next
In my experience, serverless architectures can scale really well if done right. We made sure to minimize cold start latencies, and the system has handled peaks in traffic well so far.
username4 7 months ago prev next
I wonder how pricing comparison looks to traditional server-based architectures. Interested in sharing?
username1 7 months ago next
Sure, I didn't have to worry about upgrading the server sizes like before and could handle variations with ease. So in the long run, it saves money and effort.
username5 7 months ago prev next
Amazing, I have been wanting to learn this for a while. Are there any open-source projects you would recommend to start learning?
username1 7 months ago next
There are plenty of open-source projects using serverless architectures that you can learn from. For instance, Aurora Serverless for databases, or even Firebase. Or if you just want to learn about AWS Lambda, you can build small functions and test them on your local.
username6 7 months ago prev next
Kudos! Storage is always a concern when we talk about serverless, disk storage is limited right? How do you manage that?
username1 7 months ago next
Yes, that's true. However, we chose to upload and store all songs in S3 storage. That way we can take advantage of its scalability and redundancy.
username7 7 months ago prev next
What are some difficult challenges you faced building a serverless architecture? Would you still choose this approach?
username1 7 months ago next
Building a streaming music service has its challenges regardless of architecture choice. With serverless, some challenges include handling cold starts and managing lower-level dependencies. But SSL is well-suited for handling high-volume file handling and analytics, so I'd certainly choose it again.
username8&q…[372chars]uot;, 7 months ago prev next
I'm curious about the choice of event source. How did you determine which AWS events to use?
username1 7 months ago next
I chose Amazon S3 objects, for triggering lambda. The service is relatively simple. When a new song is uploaded to an S3 bucket, a lambda function was triggered which does the various processing and saving them to database.
username9 7 months ago prev next
Great job, I'm a fan of event-drive microservices. I think this is the future :) One question, what's your database technology?
username1 7 months ago next
I used DynamoDB for storing user profiles and lists of songs, it's all backed by NoSQL. Since music files are stored in S3, linking them with metadata in DynamoDB is straight forward.