Core tenets

Cloud-native applications must be scalable and available. In order to achieve this bar, resilient systems in the cloud must make use of the concepts introduced in this chapter. We've summarized the core tenets that one should abide by to build cloud-native applications as follows:

  • Compute is distributed and the application is stateless:
    • Distribute across multiple zones and geographies. Take full advantage of the scale of hyper-cloud providers and build your own systems to be multi-zonal or multi-regional.
    • A stateful application keeps data about each session on the machine and uses that data while the session is active. A stateless application, however, does not keep any session state data on the server/host. Instead, the session data is stored on the client and passed to the server as needed. This allows compute resources to be used interchangeably as needed (for example, when an ASG expands or contracts the number of compute resources in a group).
  • Storage is non-local and distributed:
    • Utilize cloud storage services which provide redundancy to your data by design. Services from AWS such as Simple Storage Service (S3) and Elastic Block Store (EBS) automatically replicate your data across multiple AZs and multiple hard disks.
    • Utilizing distributed caching solutions such as Redis and Memcache helps support stateless application architectures. This offloads common data and objects from the elastic web and app layers into a common data store.
    • Use database solutions that distribute data and tolerate hardware or node failures. Multi-AZ database deployments or fully managed NoSQL DB services like AWS DynamoDB provide inherent redundancy and resiliency.
  • Create physically redundant network connections:
    • Even the most advanced applications can fail if network connections are severed and there is no failover plan. Architect redundant network connectivity to the cloud from your existing data center or network exchange. This is a foundational architecture decision that will pay dividends in an extreme failure event. This mentality also applies to network hardware on-premise. Do not terminate a private link and its redundant VPN connection on the same network gear. Have at least two physically separate resources to rely on.
  • Monitor extensively and exhaustively:
    • Without intelligent, thorough, and continuous monitoring, you cannot build a scalable and highly available system. By monitoring at all levels of the stack, you can build automation to enable self-healing infrastructures and find common failure modes. Furthermore, as you build a historical record of how the system behaves over time, patterns emerge for you to intelligently scale ahead of anticipated traffic increases and address system performance bottlenecks.
  • Use IaC:
    • By expressing stacks as code, you can apply all the benefits of agile software development methodologies to the deployment and management of IT systems. This is a crucial point in order to build cloud-native applications, since without it, several of the concepts introduced in this chapter would not be possible.
  • Every deployment is immutable:
    • Enforce a policy of adopting changes to a system at the lowest level possible. If you need to apply an update or patch an application, deploy a new updated VM based on a new image or launch a new container with your updated application. This is as much a cultural shift for the organization as it is a technological one.
  • Design and implement the self-healing infrastructure whenever possible:
    • Reduce your operational overhead by deploying resources and building systems that repair themselves. Expect and anticipate failures, even in the cloud. CSPs services and virtual machines are not immune to hardware or network failures, nor should you expect 100% uptime. Take this into account and deploy across multiple geographic zones and distribute.
  • Deployment anti-patterns are automatically reported and prevented:
    • By treating IaC and adopting immutable deployments, every change to a stack can be monitored and inspected. Build in configuration checks and rules into the environment to prevent changes. Build code checks into your pipeline to flag non-compliant systems before they are deployed. This will be covered in more detail in Chapter 8, Cloud Native Operations.
  • Create and maintain an Operational Control Pane:
    • Create custom dashboards tailored to your application and system. Use a combination of built-in cloud logging services and custom metrics to aggregate critical data into one view. Furthermore, create rules to flag or notify admins when metrics exceed normal behavior.
  • Scalability versus Elasticityknow the difference and architect appropriately:
    • The scalability afforded by cloud gives users almost infinite capacity to grow their application. Scalability requirements for your application will depend on where your users are based, your global ambitions, and which specific resource type is needed. Elasticity is an architectural feature which you must design and build into your system. This means that your system can expand and contract to match a user's demand. This leads to performance and cost optimization.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset