The architectural focus is on a 3 tier architecture consisting of
- Presentation Layer – transfers data from the user and between services
- Business Logic Layer – performs tasks useful for the user, retrieval, processing, transformation and management of data, business logic and policies
- Data Access Layer – stores and retrieves data for the BLL which is then transformed and passed to the user
For each layer you must consider the following technical aspects
- Resiliency – ability to recover well
- Reliability – trustworthyness of the service and the data
- Scalability – ability to grow and shrink as load changes over time
- Availability – reachability of the services
- Disaster Recovery – ability to recover after a catastrophic event
As well as the security aspects
- Privacy
- Denial of Service
Management of the environment includes
- Service Provisioning – Launching the service
- Monitoring/Logging
- Alerting
- Responding
- Capacity Planning
- Cost Management
Twelve Factor Methodology
App design should follow the Twelve Factor App Development methodology.
- Codebase – Track all code in a source code repository
- Dependencies – Use containers and package all dependencies into the container.
- Configuration – Separate configuration from code base. Store configuration in environment variables.
- Backing Services – Treat storage and messaging queues as external services.
- Build, Release Run – Separate development into the three stages
- Processes – Apps run as processes. These processes should be stateless and not share data with other processes. Data should be persisted in an external backing service.
- Port Binding – Do not use app containers (Tomcat, etc.) instead package the webserver library in the container and expose the port as an evnironment variable.
- Concurrency – Decompose your app into independent processes which can scale on demand.
- Disposability – Apps should be able to be removed and restarted easily and quickly.
- Environment Parity – Dev, Test, Prod, etc. should be kept as similar as possible.
- Logs – Decouple log collection, processing and analysis from apps
- Admin Processes – Decouple one-off admin tasks (reporting, backups, batch jobs, etc.) from the app itself
Depolyments and Testing
- Blue/Green Deployment – Is a way of performing a controlled depolyment of a new version of an application. You have two identical environments, blue and green. If blue is the production environment, you implement the new version to the green staging environment. In the green environment you can perform any final tests and when ready, gracefully cut over all users. If needed failback to blue.
- A/B Testing – Is for testing new software features. It is not used for deploying the feature.
- Canary Deployments – Deploys new features/version to a subset of all users allowing for user feedback and bug identification before making available to all users.
- Rolling Deployments / Upgrades – Deploys a new version of the OS or application to a subset of the servers as load on those servers is removed. Generally best used with stateless servers managed through a load balancer.