N-Tier Architecture (or Multi-tier Architecture) is all about having all of your different functions within a software e.g. (data, presentation, processing) physically and logically separated.
N in the name refers to any number from 1
In this example, the application has been divided into three different tiers all with different functions
-
When you work on one section, the changes will not affect the other functions of the software.
-
If there is a problem it is much easier to locate as opposed to traditional monolithic Architecture
-
You can secure each of the three tiers separately using different firewall settings, this has been implemented in the VPC that we will create soon
-
It offers scalability, if we need to add more resources, it can be done per tier without the need to effect other tiers
-
Reusability, we can take a tier from one project and implement it onto another project without the need to remake the whole tier again, thus saving time
-
Our Webapp tier will run the application and show the webpage on the browse
-
Our database tier will connect with mongoDB to collect some data and show it on our web browser
-
To ensure that our database is more secure, we will create a public subnet to host our app and a private subnet to host our database, after having downloaded mongoDB onto our DB we will remove all connections to the outside internet and only allow SSHing in from a secure Bastion server
-
This ensures that our Databse is much more secure than our app
- Ingress -->
- Egress -->
-
The /16 means that in order for something to share the same network as our VPC, the first two octets must match,
124.11
-
When creating our subnets you will see how we have implemented this
the VPC we have previously made
As previously stated, our software will be a two-tier architecture and thus we will have separate subnets for our app and DB
found on the top
our subnet is created within it. We then must give our subnet it's own Ipv4 CIDR block
- Note that the first two octets are the same as our VPC, ensuring it is within it's network.
- We will then change the number in the third octet to differentiate this subnet so that later we can attack our EC2 to it
- Note how this time the number in the third octet has been changed to 2
edit routes
- 0.0.0.0/0 refers to the whole internet and we attach this to the igw we made earlier, then click create
3) While still selecting the public route table, we can then click on subnet associations and edit associations located on the bottom of the screen
- This is the route instances in our public subnet will take to interact with the internet
2) We will then give it a conventional name and make sure it is attached to the VPC that we had created earlier, then click create
- Will explain configuration