Nihilate / Roboragi

Roboragi is a Reddit bot which helps link anime, manga, and other Japanese media.
GNU Affero General Public License v3.0
164 stars 30 forks source link

Pick a cloud service provider #47

Open Nihilate opened 6 years ago

Nihilate commented 6 years ago

Roboragi is currently on a VM in Azure for cost reasons (I have a bunch of free credits), but this is not a long-term solution. I need to investigate the other products and providers (e.g. Azure's App Services or AWS's Elastic Beanstalk), especially with regard to databases. At a glance, AWS looks comparable to Azure in terms of application hosting, but AWS's DynamoDB is way cheaper than Azure's CosmosDB. A CI tool like Travis might be a better option if I make the switch from Azure to AWS.

Goals:

reillysiemens commented 6 years ago

Do you have any metrics about the usage of Roboragi that might help inform this decision? Memory usage? Network usage? Database size?

How do providers like DigitalOcean or Google Cloud Platform look from your perspective?

Is the current deployment on a Windows platform or a Unix variant?

As far as cost goes, have you considered soliciting community donations (Bitcoin, etc.) to help offset the cost of switching providers? If the community chipped in maybe hosting would pay for itself.

Nihilate commented 6 years ago

It previously ran off a Raspberry Pi 2B, so the CPU/RAM requirements are super low - 1GB of RAM (maybe 2 for future proofing) and 1 vCPU (something like AWS's t2.micro/t2.small). Network usage looks to be around 40gb in/4gb out over the past month, but those numbers could easily reduce with caching/search code improvements. The database is currently around 150mb, but it was scrapped and restarted recently, so I'd guess it would be around 500mb for 3 years worth of traffic (the rate of increase has been slowly increasing over time). I'd guess the database gets around 1-2 transactions per second between both read and write, but I'd expect the reads to increase if the bulk of the data is cached in the database.

I'd prefer to stick with Azure or AWS to be honest - more for the sake of learning than anything else. I'm in the process of learning to use Azure for work, and given AWS has the biggest market share it seems wise to learn how to use that at some point as well. Cost isn't a huge factor as long as it's not costing more than ~10 USD/month, so I'm happy to pay a little more if that's the case (unless DO/GCP are cheaper by an order of magnitude).

Deployment is currently to a Windows machine (mostly due to familiarity - work is full-stack Microsoft), but I have no issues with running it on some flavour of Unix.

I'm not really interested in soliciting donations at the moment - I look at Roboragi as a hobby/learning exercise, so I'm happy to cover the costs myself (as long as they're not exorbitantly high). I'll likely add something if/when I add a website, since I'm hoping to add a few features which will pull in traffic from places outside Reddit.

My current thinking is:

reillysiemens commented 6 years ago

Thanks for the detailed answer, @Nihilate! This doesn't sound like a very resource intensive deployment to me, so I think you've got your pick of platforms, but I completely understand your rationale for wanting to stick with Azure/AWS. I've never used either of those, so I can't really offer an argument swaying one way or another.

I think your current thinking sounds really solid. As I personally have the most experience with Unix platforms and no proper Windows development environment my vote would be for an AWS/Unix deployment, but then again I'm not the one paying for hosting. :smirk:

Nihilate commented 6 years ago

Yeah, I'm definitely with you on the Windows/Unix front - given how portable Python is (and how much cheaper Unix machine are) there's no real reason not to. The only hiccup is me being more used to managing/debugging Windows stuff, but it's a good excuse to learn haha.

AWS definitely looks like the better option too - the pricing might be similar for larger applications, but for something so small there's a big gap in Azure's offerings.

I'll do some more research over the next week, but unless something big comes up I'm leaning toward AWS.

reillysiemens commented 6 years ago

If you do go with a Unix option I'll be more than happy to lend my expertise where it's useful, but be forewarned, I don't have nearly as much experience with containerized solutions as I'd like, so that will be a learning experience for me. :sweat_smile:

Nihilate commented 6 years ago

Haha, no worries. I've got some basic containers running Debian for both Roboragi and the Postgres DB (for the sake of not having a full DB installed locally), so I don't think it'll be much work. I'd like to get the config situation fixed before pushing the Docker stuff up though, since it'll be a nightmare to manage without it.

o-rende commented 5 years ago

I just want to throw in a suggestion for a Unix server on Digital Ocean. Judging from the hardware requirements you mention above, you could probably get away with the cheapest instance ($5/month) which is a pretty competitive price.

For CI/CD, perhaps the free tiers of CircleCI or TravisCI could be worth trying? Combined with containerization, it will make deployment a bit easier.

I also recommend looking into Sentry.io for error reporting and log aggregation.