Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Figure out hosting #60

Open
codetheweb opened this issue Aug 19, 2020 · 1 comment
Open

Figure out hosting #60

codetheweb opened this issue Aug 19, 2020 · 1 comment
Labels
WIP Work in Progress
Milestone

Comments

@codetheweb
Copy link
Collaborator

If we all decide we all want to host and want some way to all get hits on the sites, because that'd be kinda cool. Then we can figure out a load balancing solution that points to everyone's servers in a round-robin fashion.

I was thinking about this a couple weeks ago, I think arguably the easiest and most "available" way to go about it would to run the front-end site on GitHub pages, with the round robin back-end selection implementation thrown in. So it would just end up selecting off of one of the official back-ends in the code.

That's a nice solution, the only issue would be if we wanted to make the API available for other people to use. I guess we could do DNS failover for api.domain.com for third-party consumers and then mirror that list in JS for browsers with the benefit of not having to wait for DNS propagation in the event of a node going down.

The other solution would be Cloudflare, they supposedly have 0-downtime failover (for free) if you proxy your traffic through them. A benefit of that would be no exposed IP addresses. I'd rather not make my IPv4 public unless it's necessary.

GitHub workflows can be run on a cron schedule. So it'd be possible to have a job execute every 10 minutes that runs the scrapper and outputs the result to a JSON file that's then saved in the repo somewhere. Dealing with dynamic data this way would let us neatly sidestep the whole issue of keeping different database nodes and backends in sync. With this solution, the static frontend would be hosted by GitHub pages and it would load the data from that saved JSON file rather than an API.

@codetheweb codetheweb added the WIP Work in Progress label Aug 19, 2020
@codetheweb codetheweb added this to the v1 milestone Aug 19, 2020
@codetheweb
Copy link
Collaborator Author

Another option that I saw recently and could be fun to try out is Fly. Free plan has $10 / month of credit forever.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
WIP Work in Progress
Projects
None yet
Development

No branches or pull requests

1 participant