Hey Hashnodes! Hashnoders? Hashnodians? lol
I've always struggled with setting up server infra. I would really appreciate if you could help me around this with your experience and insights.
For example:
I need to set up a server for Audiobook app;
Assumptions:
- 5k users.
- 500 active users at any given moment. Might peak up to 1k users during the day for a couple of hours.
- They stream/download a 15MB file every 10min => 1.5MB/min; I don't know whether this is import data to consider or not.
- The database has user info, audiobook file info.
- In the future, I would like to have a track of who is listening to what to recommend related stuff. This adds more requests to the server.
Stack:
- Front-end: ReactJS
- Back-end: Not sure yet - Nodejs, specifically free plan of firebase instance. This is where the real question is. Is a free plan of firebase enough? If I were to set up a custom server(which I believe I should) on Digital Ocean, what should be the minimum infra?
Hope that makes sense. Please let me know if more data is needed.
Though I am giving an example(assuming it is required), I would like to know generally, what would you consider while designing a server.
Cheers!
That's not a lot of data or users on a server so it would be more of a micro-optimisation i think. You could probably just jump on AWS and spin up a t2-medium (pretty standard size) and see how things go. You could probs get away with 4 vCPU, 2gb ram, 1tb storage - maybe less.
Things to think about:
I don't have a great deal of experience with digital ocean so my suggestion would be google or AWS with further preference, for your case, to google as you can get $300 for free on signup just to test out the app and you get lovely messages about usage and how to save money so its pretty simple and quick to setup.
Due to the low usage you could just spin up 1 server with a HTTP routing setup and DB (presumably mongoDB if your using nodejs?)
setup linux server (my preference is centos - but use whatever you want really) add nodejs and whatever you need
blog.kevinchisholm.com/amazon-web-services/aws-ec…
stackoverflow.com/questions/48937447/how-to-make-…
digitalocean.com/community/tutorials/how-to-set-u…
With AWS it is easier to setup your firewall/IP inbound/outbound rules but the premise remains the same. Also, maybe have a google how companies like youtube or spotify manage their setup and applications.
You could use firebase but that might be a bit overkill initially. However, on the other hand you can just have a go at it and see how it works and if it helps you for your needs. Overall you'll need to do more research yourself in order to select the best tools for the job.
Hope this helps.