Hello! I'm reading through the guide, particularly...
# guide
s
Hello! I'm reading through the guide, particularly interested in organizing multi-microservice serverless application in monorepo. In the chapter https://serverless-stack.com/chapters/organizing-serverless-projects.html it seems that you are proposing to use single serverless.yml per each service (billing-api, notes-api, notify-job). Do you have any thoughts or recommendations how to achieve the same using SST only?
a
I had the same question.
The problem is if you do that, you can’t take advantage of re-using or do code-sharing.
s
I guess code sharing would be done by putting the shared code to some core lib module, and then referencing it in other modules. Because of monorepo we should be able to this pretty easily. What I'm missing in the current setup is to be able to deploy microservices independently - we can do some "logical" division into subfolders and create separate stacks, but from what I understand sst deploy would just deploy them all everytime.
a
You can deploy stacks individually. And define the dependencies for it.
s
could you point me to any example or docs?
a
You can deploy individually with the sst command.
There is a
--stack
or something like that.
And dependencies, you can define depenciies like…
stack1.addDependency(stack2);
.
s
Thanks! I will try it out