My lambda layer for running my app and migrations ...
# prisma-migrate
m
My lambda layer for running my app and migrations - bummer that the dependencies for prisma clock in at 80MB 😩 (not counting @prisma/sdk or @prisma/migrate)
r
80 MB Zipped?
m
Uncompressed
r
Deleting
@prisma/engines
should reduce the size. Also having separate functions lambdas for the app and migrations would make sure only a single binary is packaged in a single lambda.
m
Yes but if I remove the engine binaries then my migrations and app don’t work
This is a layer for my application
p
is it a requirement to have your migrations working on this layer?
m
Not really no
I was trying to use the NodeJsLambda construct to bundle @prisma/migrate and @prisma/sdk with my migration function, however they try to import ā€œ../package.jsonā€ which is a pain but I found a workaround. but I still need the binary and my release takes the same time either way since it’s just moving from one part of the deployment to another
it just seems weird to need 90MB of binaries to do this stuff i guess
p
I would suggest separating them. Try to keep your runtime layer as minimum as possible by running migrations somewhere else and removing from this layer. is this possible?
plus one +1 1
r
I agree! Having separate lambdas for querying and migrations would make this much better. Also imo in this case, layers aren’t required. Bundling it with the Lambda would be better.