
上QQ阅读APP看书,第一时间看更新
Organization of the application code
Organization of our application code is entirely different than our prior discussion, although there is a bit of overlap.
Laying out application code in a serverless project is slightly different than in a traditional web application. While the differences aren't that drastic, I find serverless projects a bit more susceptible and intolerant of designs or layouts that are not thought through in detail. Because it's so easy to get started, it's also easy to start moving in the wrong direction before thinking through and answering essential design decisions.
Over the years, these are a few of the big lessons I've learned when writing serverless application code:
- Configuration should be done with environment variables, rather than different configuration files
- Application code should be well structured, highly modular, and namespaced
- Think through how many functions you need before coding begins