:wave: can someone explain me in plain english wha...
# help
k
👋 can someone explain me in plain english what are these
layers
and why do we need them in
sst
? When I look to
prisma
example I just don't get it https://github.com/serverless-stack/serverless-stack/blob/master/examples/prisma/stacks/MyStack.ts
k
@Karolis Stulgys You can think of Layers as predefined libraries (sometimes vendor code, or often used code packages) that you can link to existing projects. Lambda has a code size limit and putting some code in layers is also a way to push that restriction a bit. They can also be used for cross account code sharing. https://lumigo.io/blog/lambda-layers-when-to-use-it/
f
Thanks @Klaus! Actually, layer size also count towards the 250MB code size limit 😞
k
@Frank wasn't fully aware of that and learned something new again