gather-community / gather

The App for Community
https://info.gather.coop
MIT License
30 stars 6 forks source link

Modernize infrastructure and deployment to enable adequate scaling under heavy loads #1017

Open robotastronaut opened 6 months ago

robotastronaut commented 6 months ago

Some routes get hammered during certain high-traffic activities. For example, /work/signups gets polled by entire communities while selecting jobs for a given period, which leads to some bottlenecking, which means people are smashing refresh and sending even more requests, and things just block. We need to migrate to an infrastructure that allows horizontal scaling under load and perhaps even look at pulling out certain controllers into their own scale-to-zero services so we don't have to scale the whole thing.

As part of this, everything at the data layer will be moved into its own infra so it can be scaled independently from the rest of the services. Unless I'm missing something, right now this means postgres, redis, and elasticsearch. When spinning up a local development environment, you should be able to fire all of this up in containers so you aren't dealing with avoidable system service conflicts. To that end, I'm also including minio as a locally-hosted s3-compatible service to cut down on remote development dependencies.

There are many ways to solve this, and I'm open to strong opinions. Right now, the work looks like simple containerization and shoving everything into kubernetes on DOKS while also looking into KNative as a solution for handling higher load functions. Not sure how possible this is, given RoR, but there has to be straightforward solution.