Web Application Setup
Any, web-based application we create, will require configuration (or add-ons) with other tools like database, email provider etc. Also, there are many factors based on which traffic on web applications can vary. Some of the factors are like popularity of the application, availability location, target customers or occasional etc. Due, to which underlying infrastructure on which application is running also require auto-scaling. This may be required to increase or decrease the number of server instances or database reader instances etc.
Terraform can be used to codify the setup required for hosting web application. Terraform will also provide configuration management with other add-ons like database, email providers etc. Terraform is also best for configuring the elastic scaling of the application infrastructure based on desired conditions. Best of all, Terraform can do all this within no time and also just on one click or one command.
N-Tier (Multi-Tier) Application
N-Tier (Multi-Tier) Applications are developed and distributed among multiple layers of infrastructure. It’s primary purpose is to separate web layer (presentation layer), service layer (application layer) and data layer (database). The defined number of layers can vary according to the application architecture. Some of the examples of this architecture are makemytrip.com, Sales Force, irctc.co.in, amazon.com etc. This type of architecture is also used so that each layer can be managed independently of another layer.
Terraform is a good tool for creating and managing this multi-tier infrastructure. Each layer can be defined separately as collection of resources and can be linked automatically with another layer. Terraform ensures the dependencies management like enabling database before starting of application and enabling load balancer to aware of different application instances. Each layer can be also be scaled independently with single “count” configuration value.
This creation and management of multi-tier infrastructure along with its auto-scaling is all codified and automated through Terraform.
Self Service Infrastructure (Decentralized Application)
In earlier days, any development team before starts working on new application or service, has to demand from operational team for creation or allocation of infrastructure. In this case developers have to wait till provision and allocation of infrastructure is done. This leads to following drawbacks:
- Pre decision for cost and number of resource requirement
- Increased cost for idle resources for some period time
- Reduced productivity of development team and increased cost of project
- Increased risk of managing infrastructure manually and alsoerror prone.
Terraform, can be used to avoid infrastructure provisioning dependency on operational team. Terraform as infrastructure as code can be written independently and used by development team directly. This approach will provide following benefits:
- It will increase productivity of development team by reduce dependency on operational team
- This will reduce the project infra cost, because only the require infra will be provisioned
- This will reduce risk of infrastructure failure and error, because with Terraform code infrastructure can be destroyed and corrected in no time
- This will provide secure infrastructure along with governance and auditing for it.
On Demand Requirement – Software Demos, Disposable Environments
Every time we create any application, service or product for customer (client), we have to plan for demonstrations for product owners or customers. For this demonstration development or testing environment cannot be used. It will require production like environment which will only be used for demonstration and will require only for small period. In this case, creating separate on demand infrastructure can be very costly and counterproductive, if we are doing this manually.
Terraform comes to save us. Since, with Terraform entire infrastructure is created through code and with just one click or command. This will provide following benefits:
- New, Infrastructure for demonstration can be created and destroyed easily, without being dependent on anyone.
- Will reduce the chances of error and failure
- Will provide confidence in running and demonstrating an application.
- This also, can be done with disposable environments, which are only required for specific purpose for small period. Like, testing or staging environment.Most of all, this can be done on demand anytime and by any team.
Software Defined Networking
Today’s applications are very dynamic and have high-bandwidth requirements. Software Defined Networking (SDN) based architecture is emerging for this type of applications. SDN architecture is very dynamic, cost-effective, adaptable and manageable.
With SDN architecture, Network control and forwarding functions are decoupled from each other. This enables, direct programming possible for network control and underlying infrastructure can be used independently for application and network services.
Terraform can be used to provide configuration for software defined networks. Using those configurations Terraform can interact with service provider and automatically setup & modify settings for control layer. For example,AWS VPC settings can be configured and modify on AWS using Terraform.
Most of the times, application is created to be available on multiple clouds. This can be because to increase fault-tolerance or increase the product outreach by making it available on multiple clouds. By restricting application only to one cloud region or to one cloud provider, application fault tolerance is limited with that of cloud provider.
Using manual methods for multi region or multi cloud provider deployments can be very challenging. But, with Terraform which can support multiple clouds (as cloud agnostic) we can configure and deploy application on multiple clouds with little effort. Terraform helps in orchestration & simplifies management of multiple clouds.