Implementation of The 12 Factors App Methodology with AWS Cloud for a SAAS Product - Part 1
Md. Mostafa Al Mahmud
Sr. Software Engineer | AWS Community Builder | AWS Certified | SRE | Serverless | Microservice | NodeJS | TypeScript | JavaScript | Tech Speaker
This article helps the developers, programmers, solutions architects directly to integrate a #saas application following the 12 Factor App methodology in the #aws cloud architecture and the DevOps guys to maintain this type of apps under AWS platform although this methodology is absolutely applicable to several cloud platforms as well.
The 12 Factor App is an approach for creating Software-as-a-Service (SaaS) products that is:
The Twelve-Factor App principles, written by Adam Wiggins , co-founder of Heroku , are listed below that are should be implemented while building a #saas product.
1. Codebase
2. Dependencies
3. Config
6. Processes
7. Port binding
8. Concurrency
10. Dev/prod parity
11. Logs
12. Admin processes
Let’s discuss here every factor in short step by step and communicate with the related AWS services that serve The Twelve-Factor App methodology's purposes actually. But in this article I am discussing about only 3 factors as codebase, dependencies and config.
1. Codebase (One codebase tracked in revision control, many deploys)
The first factor requires each application to have its own single source code repository, and any changes to the code should be tracked and recorded, but the application code can be deployed into many environments. This factor assumes that the application code is always stored and managed in the version control system in the different environments like dev, staging, production port, etc.?
In this case, private Git repositories are hosted by AWS CodeCommit, a managed source control solution that is safe, scalable, and secure. Teams may easily and securely collaborate on code with contributions that are both in transit and at rest encrypted. Developers don't have to worry about scaling the infrastructure of the source control system or manage it themselves while using CodeCommit.
CodeCommit can be used to store anything, including binaries and code. It integrates seamlessly with the other Git-based tools the developers already have because it supports all of Git's standard features.
2. Dependencies (Explicitly declare and isolate dependencies)
The majority of languages include a method for packaging systems for distributing support libraries like CPAN for Perl, Rubygems for Ruby, NPM for Node and so on. The second factor, which addresses dependencies, states that, for the application to be consistent with this point, implicit dependencies on packages or operating system libraries need to be avoided. The application should also use a dependency isolation tool, such as;
They have no implicit dependencies “leak in” from the surrounding system. Leveraging such tools makes it easier for freshly hired engineers to configure their environment and applications.
领英推荐
AWS CodeBuild is a fully managed continuous integration service that assembles source code, conducts tests, and generates deployable software packages. With CodeBuild, the developers never need to provision, manage, and scale their own build servers. The build process won't be kept in a queue because CodeBuild scales constantly and handles several builds at once by using prepackaged build environments.
Here is a great overview of An Introduction to AWS CodeBuild
3. Config (Store config in the environment)
Everything that is likely to change between deploys is an app's configuration (staging, production, developer environments, etc.) such as?
Many apps will occasionally retain configuration data as code constants. 12 Factor, which demands a strong separation of configuration from code, is broken by this configuration in the code base. Across deployments, configuration varies greatly, but code does not.
AWS has several services to serve this purpose such as AWS Secret Managers, Secret Manager Parameter Store, AWS Key Management Service (KMS) etc.
AWS Secrets Manager helps you manage, retrieve, and rotate database credentials, API keys, and other secrets throughout their life cycles. Also, it's configurable to rotate automatically with the help of #lambda functions defining how to that works. So the main features of secrets manager are as follows:
The communications among the process are as follows:
A 12-factor application requires the strict separation of configuration from the application code that is fulfilled in the stage.
For more info about this, read this blog Creating AWS Lambda environment variables from AWS Secrets Manager
Also, I discussed about other factors on part 2 and part 3 accordingly. Links are given below:
The Twelve-Factor App methodology is the twelve best practices that help the developers to decouple components of the app, so that each component can be reusable easily, or scaled up or down seamlessly that is considered nowadays actually as a modern, cloud-native application.?
Above all, I have discussed in this article about the topic at a high level overview and of course different solutions will have different architecture where the cloud service usages are varied based on that architecture. It will help the developers who are building a #saasstartup for brainstorming to create a software architecture.
Please follow me to get more articles in future.
Helpful contents and credit:
The official website of Twelve Factor App is The12 Factor App
Software Engineer | JavaScript | TypeScript | Go
2 年Great bhai
Software Engineer @CHEQ Inc. || React, Node, TypeScript || 2x AWS certified
2 年Thanks for sharing bhai