Considerations before creating a hybrid infrastructure with AWS
Published: 2023-04-03 22:58:49

**What is a Hybrid Architecture?**

A **hybrid architecture** **combines computing resources**, **_including local infrastructure_** **and _cloud-based services_**. 

This is typically done by companies that **want to leverage the benefits of cloud computing while still maintaining control** over specific digital **data** **or applications** that they prefer to keep **on-premises**.

_“The tricky part in making a hybrid car wasn´t sticking a battery and an electric motor into a petrol-powered car. Getting the two systems to work seamlessly and harmoniously was the critical innovation.”_

Gregor Hohpe - Cloud Strategy: A decision-based approach to Successful Cloud Migration    

**Types of hybrid setups**
Gregor, also created a [great article](https://architectelevator.com/cloud/hybrid-cloud/#hybrid-cloud-ways-to-slice-the-elephant) pointing different scenarios for hybrid architectures. 8 types of scenarios are identified:

![hybrid cloud scenarios](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lhybmdi90d2c9ew0zna4.png)

Let´s pick the **Workload Demand strategy**:
 
_Companies can benefit from the cloud's elasticity to increase the capacity of their services at a burst, when is needed. Another benefit is the Cloud billing model, you pay for what you use, when you use it_

**Example**

Imagine the scenario where you are the solutions architect in a company that sells online tickets for the last concert of a famous group, let´s say Rammstein. 

![Exercise description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7i9sfso5cwlrt2li79o3.png)

You are going to receive so many requests when the tickets are on sale, it will look like you are receiving a DDoS attack.

You are in charge, nothing can fail, the reputation of the company is at your hand and you don´t want that your server room looks like this:

![This is fine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k1scycjn7noyl6fei1p5.jpg)

If **you build a proper hybrid architecture**, _you can overcome any overload problem and avoid any disaster or chance to offer a bad service for your end customers_.

The following image is a simplified version of a hybrid architecture solution for our example →

![Hybrid Architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wc1xywezkdfrd14jzh3i.png)

In this architecture, we extend and distribute the application between the different EC2 instances and the on-premise hardware using the [Direct Connect](https://aws.amazon.com/directconnect/?nc1=h_ls) service. These EC2 instances are part of autoscaling groups in different AZs that will scale out at a burst based on our defined rules of HW utilization.

Thanks to the elasticity of the cloud, this design will scale out and scale in once you are sold out with the tickets.

If, for example, you would have used VPN instead of the Direct Connect service, you may end up having synchronization issues if there is high latency between the on-premises and the cloud. How can you keep communication almost in real time with a bad latency?.

In the end, you will have customers who will have a bad experience and this will negatively impact your image as an architect and your employer. This scenario could be avoided

Not all hybrid architectures require the exact requirements; for this one, low latency is a must.

**Considerations**
**What options do I have to create a hybrid cloud infrastructure?**

VPN Over the internet
![VPN](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldwj61li5cwev1osa0zm.png)

_In a hybrid-cloud scenario, VPN is the fastest way to achieve the goal, but there are some downsides if you have to rely on the solution:_

-       The connection is Encrypted, but it is no private - DDoS risk
-	Unpredictable latency
-	Limited throughput – up to 1.25 Gbps - (It can scale with the use of a transit gateway)
-	Low setup costs but high egress traffic costs after a certain amount of data
-	No end-to-end SLAs

**AWS Direct Connect**
![AWS Direct Connect](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pdkcxjla1yjmrw1nm198.png)

Direct Connect is a private way to connect your on-premises infrastructure with a fiber optic connection to AWS inside a data center. This solution is not the fastest/cheapest to deploy; it is more complicated to design, but it provides some advantages like:

-	Extra security (connection outside of the public internet) but not encrypted by default, (possibility of [MACsec encryption](https://docs.aws.amazon.com/directconnect/latest/UserGuide/MACsec.html))
-	Lowest possible latency
-	High throughput – from 50Mbps up to 100Gbps
-	Cost-effective solution after a certain amount of data
-	Enterprise-grade SLA

**What to choose: Direct Connect or VPN?**

This will depend on the company's needs; SLA, latency, bandwidth, and time to deploy are some factors that will help you make the final decision. 

[![Direct Connect vs VPN](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmwr3kprl07kx6qzm3ju.jpg)](https://docs.aws.amazon.com/whitepapers/latest/hybrid-connectivity/connectivity-type-selection-summary.html)

**Conclusion**

**Planning and implementing a network design** that meets your business needs and requirements **is essential** to ensure a successful hybrid cloud deployment in AWS. _Not doing a proper analysis can negatively impact the business in all aspects._

**Networking is the key to success**: _Strong networking, seamless integration_