https://serverless-stack.com/ logo
#help
Title
# help
k

Karolis Stulgys

05/24/2022, 7:05 AM
👋 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

Klaus

05/24/2022, 8:00 AM
@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

Frank

05/25/2022, 3:17 PM
Thanks @Klaus! Actually, layer size also count towards the 250MB code size limit 😞
k

Klaus

05/25/2022, 3:19 PM
@Frank wasn't fully aware of that and learned something new again
2 Views