| We follow a very similar pattern and we are at over 150 micro services right now (AWS Lambda). A couple of things different that we do since we are building and then deploying to AWS: - Build only on dedicated deployment branches (beta, qa, preview, prod) - Build all functions (transpile, yarn, lint, etc) on every merge into the branch, but only deploy functions with different checksums (saves on api calls to AWS) - We cache node_modules, but otherwise don't have any special build requirements and babel takes care of targeting node6.10 for Lambda Total build time is between 8-13 minutes. There are some things we can do to speed up install that we haven't yet because it's not an issue yet but just a short list of things to note. - Each function has it's own package.json for it's own packages. We maintain a list of npm packages that we download into a single folder first (that doesn't get deployed) to allow yarn to use those files from cache. We will eventually switch to an offline install for each function which essentially just copies the package folder and sets up anything it needs. - We have a tarball package that includes all of our shared code / config files. Yarn seems to always want to download this file, regardless if we pre-download it. - We deploy a single api endpoint for all of our micro services through API Gateway which cuts down on the time to deploy since API Gateway has a pretty hard throttle. This means we create a deployment on API Gateway every merge. We have one APIG for each environment |
Looks like a pretty solid build process. Thanks for the insight!