Posts

Showing posts with the label amazon

AWS - Databases DynamoDB, RDS

Image
AWS - Databases There are 3 main database types in software world: Relational databases (MySql, Postgre, Amazon RDS etc.) Non-relational databases (Mongo, Amazon DynamoDB etc.) Graph databases (Amazon Neptune, NebulaGraph etc.) For your specific use case they have advantages and disadvantages.  We will cover relational and non-relational databases in this post.  Relational databases - as name implies stores information based on defined relation. Organized by tables, columns, rows. Supports complex queries and joins. Non-relational databases - contrary to the relational databases non-relational databases are more flexible. Documents, key/value, columns and graphs are some forms can be used to organize data. Databases in Amazon There are few ways to use database in AWS : Database on EC2 - We deploy any database software onto our instance and use it like this. Amazon RDS  - Amazon provided service, under the hood you can use (MySql,Postgre,Maria Amazon Aurora etc.) relationa...

S3 - Create a static website

Image
 S3 - Create a static website Creating static website with S3 bucket is very easy. This will make not only your website fast but also hassle-free and cheap alternative to traditional hosting. Please read this post before going further -  https://www.learn-aws.com/2024/11/s3.html  Create a bucket and set the permissions.  Click on the bucket, and navigate to the "Properties" tab, scroll down you will see this option. Edit it like below. Create a simple index.html file like the one below and upload it with the files you used in index file. In this case "aws.png" is also uploaded into the bucket as well. <html> <title> Hello from AWS S3 </title> <body> <img src="aws.png" alt="AWS"> </body> </html>  If we do everything right, we will be able to see rendered html when we copy and paste the link in the index file's link in S3 service.

S3

Image
 S3 In AWS S3 storage is special kind of storage that provides flexibility that other kind of storage services don't provide. S3 is sitting internet facing subnet and if we want to access S3 bucket from our private subnet we need to either direct traffic over internet gateway or use S3 gateway endpoint service.  To access or upload files to S3 we must use REST API for that. This actually makes things easier because thanks to this we will be able to do all operations programmatically (via our favorite programming language). In block storage service we supposed to use operating system to perform all the tasks. There should be some kind of hierarchy. But in S3 files storage in "bucket"s. Hierarchy can be mimicked by prefixes.  Let's create bucket and access over internet Search S3 in the search bar  Create a bucket Name must be unique otherwise it will display an error. Use default settings. After that try to upload some files there. Click to that file you will see the ...

Security groups, Network ACL and Firewall

Image
 Security groups, Network ACL and Firewall Stateful and Stateless firewall - when connection initiated from client firewall checks the rules written and based on the defined rules allows/denies the traffic. Client initiates connection from any port (except the reserved by the OS) but destination port is known and static. So stateful firewall which as name implies keeps the state of connection so that even though there is no outbound rule for the outgoing connection, firewall will automatically allow it. Contrary to this approach in stateless firewall case you should explicitly define rule for inbound and outbound connections.   Network Access Control List (Network ACL) -  is stateless firewall allows you to define rules in subnet level. Also it processes rules in order. Security group - on the other hand stateful and also applied to individual instance or instance group . It evaluates all the rules.  Let's learn how to manage Network ACL's : Search VPC in the s...

VPC - Virtual Private Cloud

Image
OSI model consists of 7 layer : 1. Physical layer - Raw bits transfered over cable via electrical signals. 2. Data link - Switches direct these electrical signals. They use MAC address to identify the next destination.  3. Network layer - Routers receive frames from Data link layer and directs them to the destination based on the address defined in the frame. They use IP (Internet protocol) to identify the next destination. ICMP, ARP are example protocols work on this layer. 4. Transport layer - This layer manages delivery and error checking. TCP,UDP are the examples of protocols work on this layer. 5. Session layer - This layer controls communication between two computers. Netbios,PPTP is the one of the example works on this layer. 6. Presentation layer - This layer is responsible for encryption/decryption of data. SSL, TLS are examples. 7. Application layer - The final layer where user interacts. Example protocols : HTTP,SMTP, FTP etc. So we can say that switches connect computer...

EC2 - Load Balancing and Auto scaling

Image
Load balancing and Auto scaling Let's suppose we have deployed our web application to the EC2 instance. And all of the sudden, our app. got viral and previously 10k daily users became 1 million. So we want our infrastructure to use less resources when there is little or no user, more when there is high load or spike, it somehow must adjust itself in a way to withstand to this load. This is when auto scaling comes into play. Load balancer - is a proxy that allows you to distribute connections to servers. It provides fault tolerance and high availability . Load balancer can be front of  EC2,ECS, other load balancers, lambda functions etc. There are 3 types of load balancer in AWS: Application load balancer (operates at Application layer (L7) http, https etc.) Network load balancer (operates at IP layer (L4) -  TCP, TLS, UDP etc.)  Gateway load balancer (uses Geneva protocol, balances firewalls,IDS/IPS, operates at layer 3 ) Auto scaling - allows you to automatically and ter...