Pages

Thursday, November 30, 2023

Amazon ELB load balancing, Amazon SQS and SNS note

 elastic load balance:



- route request to multiple instances

- evenly distribution load to multiple ec2 instance

- monitor ec2 instance ( combine with auto scalling ) to forward request whenever the server is up / down. stop forwarding to dead ec2 instance



- adding more  backend without interupting front end process  // decoupled architecturee




=============



- low demand period

- high demand period



============


// messaging and queueing



buffer = placing message into a buffer





// tight coupled architecture


cashier - straigh talk to barista.   // single component fail it causes issues for other compontents or even the whole system.



app a error - app b ikt error




// loosely coupled architecture


single failure wont cause cascading failures

one single failure is isolated so wont cause cascading failures





app A -- Message Queue -- app B


if app B fail.. A not fail.

app A will still send to message Queue until app B up again



============


// messaging and queueing




messaging  remain in the quue until they are consumed or deleted







// amazon simple queue service ( SQS - queue)


Using Amazon SQS, you can send, store, and receive messages between software components, without losing messages or requiring other services to be available. In Amazon SQS, an application sends messages into a queue. A user or service retrieves a message from the queue, processes it, and then deletes it from the queue.





- send store receive  msg between  software component at any vol.

- msg are placed in queue until they are processed

- scale automatically, easy configure and used

- can send notification



data contained within msg is called payload.  // protected until delivery 




- person name, coffee order, time order  => digabung jd payload. dimasukin ke SQS







// amazon simple notification service ( SNS )



bs berupa email,txt msg , push notif / http request. skali di push, sent ke semua subscriber





// buat ngasih notification ke user.   => bs berupa email,txt msg , push notif / http request

publish / subscribe model


sns topic : a channel for msg to be delivered


configure subscriber ke topic -> lalu publish msg to those subscriber


1 message to topic => disebar ke banyak subscriber skali jalan.




subscribernya bs end point jg kyk : 

- sqs queues

- aws lambda

- https / http web hook 



bs jg ngasih notification ke end user via:

- mobile push

- sms

- email 



=============




================



monolithic application. 


No comments:

Post a Comment