- CDN : Content Delivery Network
- Ex: Instance --> User uploads --> Image --> Instagram will have a Central storage system (Australia)
- Instagram copies the image that we have uploaded --> Now anybody in the world can access the image by using instagarm (Central stroage system)
- A friend of the user --> trying to access the image --> In his instagram account
- The user in india (Centeral storage system is in U.S) --> For this person in india to access the image
- The request will go to muliple routers multiple Hawks to reach server and again it goes to multiple Hawks to reach the central storage system)
- From storage system --> Goes to Instagram server --> To User
- HAWKS -- MULTIPLE ROUTERS
- (Available in US) --> The users in US can get the content very fast
- The users in other countries like India they will have loading time Litency is high. UX is not good.
-
User uploads an image (US) --> Goes to central storage system --> We will place a CDN here
-
People from other parts of world -- anyone trying to access this image -- Instead of accessing the instagram server directly
-
We will map the CDN to the instagram DNS and we will tell to access CDN
-
CDN is the service in AWS Cloud front --> Either access my CDN or we will map the domain name DNS with CDN
-
Whenever the person in india when they try to access the image they will directly talk to the CDN --> CDN WILL CREATES LOCAL COPIES OF THE IMAGE
-
Muliple copies of the image will be stored in the EDGE LOCATIONS (Copy in india region, US, and etc)
-
Now user ---> Instead of going to central region we can get the image from india region
-
When someone upload a reels or post in instagram --> intagram usese the CDN and it stores the image or reel in multiple local storage locations.
-
Instead of image stored in the Central location it will stored on EDGE LOCATIONS.
-
s3 bucket -->
-
Block all access --> Should be enabled be'coz we are using direct access to S3 buckets itself to the USER
-
Click on Bucket -> Properties --> Static Website hosting --> Enable it
-
Upload any static webpage index.html
https://github.com/pavankumar0077/lightweight-gallery/blob/main/index.html -
Go to bucket properties --> In the last you will find URL --> When we try it will show 403 error --> Be'coz we blocked public access
-
NOW WE HAVE TO USE CLOUD FRONT
-
Click on create new OAI TO ACCESS THE S3
-
S3 bucket policy will be added
-
CREATE DISTRIBUTION
-
If we copy and check distributed domain name












