sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.13k stars 136 forks source link

Stacks / Ways to break up your deployments? #282

Open ivands opened 2 months ago

ivands commented 2 months ago

Our current project is quite big and we break it up into multiple stacks. I'm wondering if there are still ways to break up the deployment into multiple stacks, to isolate the surface area from anything that can go wrong.

ivands commented 1 month ago

Or if there are plans to support this in the future?

jayair commented 1 month ago

Do you mean Pulumi's stacks or do you just mean organizing resources separately? https://github.com/sst/ion/tree/dev/examples/aws-monorepo/infra

thdxr commented 1 month ago

breaking up into stacks in v2 didn't really provide any benefits - they still all get deployed together and we only had to break things up for arbitrary cfn limits

breaking your code up makes sense for organization purposes and we have an example in aws-monorepo

is there any specific problem you're looking to solve?

ivands commented 1 month ago

The benefit would be that you can have multiple teams take responsibility for parts of the code base and deploy it independently without worrying that you will break some other part of the total project.

thdxr commented 1 month ago

breaking up into stacks in v2 didn't really provide any benefits - they still all get deployed together and we only had to break things up for arbitrary cfn limits

breaking your code up makes sense for organization purposes and we have an example in aws-monorepo

is there any specific problem you're looking to solve

ivands commented 3 weeks ago

Ok, let me explain one of the downsides. I work on the same project with a team. For development, you sometimes need to deploy stuff to staging to debug/test your code. When working in different stacks, one person can simply deploy their own stack without worrying that they will change anything in the rest of the project.

We also have a project where you can only deploy the whole project. We must communicate constantly to not break anything someone else is working on.

Are there better ways to solve this issue than by breaking your code into separate stacks?

thdxr commented 2 weeks ago

ok so i have some ideas here that may help

ivands commented 2 weeks ago

So, what you're saying is it would still be possible to deploy only a subset of the resources inside your project by prefixing it with a sst.Group ? And if so, how does it resolve dependencies outside the group? Because multiple strategies could be implemented here.

ivands commented 2 weeks ago

@jayair I mean real deployment isolation. Just like AWS stacks.

jayair commented 1 week ago

Yeah something like that.

We'll need to give it some thought on our side.