Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature idea: Deployment examples #49

Open
gedw99 opened this issue Nov 18, 2023 · 8 comments
Open

Feature idea: Deployment examples #49

gedw99 opened this issue Nov 18, 2023 · 8 comments

Comments

@gedw99
Copy link
Contributor

gedw99 commented Nov 18, 2023

The architecture is fast thanks for the smart layering of caches.

I was thinking that deployment examples might be useful for devs .

Fly.io can scale out Postresql and Redis automatically for example. Its requires slight changes to the Docker as fly only allow a Docker and not a Docker compose. This might sound like a problem but it is not and just requires a Dockerfile that can boot Redis and Postresql.

Anyway, there is no Dockerfile in the repo for the main golang code anyway, so we could make one that is designed for fly and scaling out Redis and Postresql if we want.

It can also be used for non fly too btw, but shaping the docker appropriately.

https://fly.io/docs/reference/redis/ for edit but you can also just boot your own.

https://fly.io/docs/postgres/ but you can also boot your own and scale out your own.

Fly makes all databases sync into all regions automatically.

The golang code scales to zero so is server less. So costs you close to nothing if you users hitting your system.

fly cli is golang and is insanely easy.

Fly anycast / bop automatically does nearest server LB, so its seamless scale out at that level too. Its pretty no brainer stuff

Most people use Cloudflare but any DNS works. SSL is done for you.

@mikestefanello
Copy link
Owner

That's an interesting idea. Can it be provided in a way that doesn't modify the existing code (ie, in a deploy directory, or something along those lines)? I've never used Fly.io before.

Perhaps also adding an example for GCP Cloud Run, Cloud SQL, and Memorystore would be useful.

@gedw99
Copy link
Contributor Author

gedw99 commented Nov 24, 2023

Yep deploy folder is perfect .

GitHub actions can use it and deploy.

@gedw99
Copy link
Contributor Author

gedw99 commented Nov 24, 2023

The other hosting providers can be done too of course. I tend to use fly because it’s anycast. So I standup an instance and via the cli or GitHub actions can scale the instance to any of the 30 data centers and it Al remains in sync.

also postresql works and scales in a master sake pattern . I normally pick Amsterdam as it’s the best for global origin. Than all slaves in the other 29 auto sync .

Clients get automatically send and load balanced to nearest DC and LB in each DC to how many instances you have in that DC.

this is why I guess I don’t use GCP or AWS.

S3 proxying also works and postresql is automatically Snapshot so if you blow away your Origin your can get your postresql data and s3 blobs.

@gedw99
Copy link
Contributor Author

gedw99 commented Nov 24, 2023

https://github.com/superfly/flyctl For cli.

https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ for git ops.

https://github.com/superfly/flyctl-actions

https://github.com/superfly/fly-pr-review-apps for GitHub or ops

https://github.com/superfly/fly-log-shipper For log shipping. I use nats as they suggest so I can log async which is much faster and takes load off main servers.

@gedw99
Copy link
Contributor Author

gedw99 commented Nov 24, 2023

For back control plane is also nats but hosted :

https://www.synadia.com/ngs

it’s identical to nats golang server used for logging but I can control fky, s3, dns, etc etc via ngs Nats. GitHub actions just call a makefile that modifies all the operational things.
Ngs is just the command and control system for talking to all this things

@gedw99
Copy link
Contributor Author

gedw99 commented Nov 24, 2023

Just realised that the docker compose has Redis and postresql.

2 options:

  1. run each standalone

https://github.com/fly-apps/redis/
https://github.com/fly-apps/postgres-ha

Then run pagoda as a dock on fly

  1. inject the binaries into the one docker

@mikestefanello mikestefanello changed the title Feastire idea: Deployment examples Feature idea: Deployment examples Dec 4, 2023
@mikestefanello
Copy link
Owner

So what would be required to add to this repo in order to make deploying via fly easier? Does this app require anything highly specific? I'm curious if including it will actually be of much help to people. As always, my concern with adding things is that it's another thing to maintain and stay on top of, so it has to be worth it. I thought about adding something for cloud run but I'm not really sure how helpful that is. The other problem is that the list of cloud providers is very long.

@gedw99
Copy link
Contributor Author

gedw99 commented Jan 5, 2024

A fly.toml
A dockerfile that runs the golang main.

The fly cli is used to run the deployment
The fly GitHub action to auto deploy it.

postresql is supported on fly. You can even scale it out using the fly cli

Redis i think is provided on fly. https://fly.io/docs/reference/redis/
I tend to use NATS Jetstream instead of Redis because you can run NATS embedded in your golang binary .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants