Adrian Cantrill’s SAA-C02 study course, 45 minutes: Serverless and Application Services section: ‘Serverless Architecture’ & ‘Simple Notification Service’
Serverless Architecture
– Serverless isn’t one single thing
– more of a software architecture than a hardware architecture
– You manage few, if any servers: low overhead
– Influenced by micsoservices and event-driven architectures
– In serverless, an application is broken down into as many tiny pieces as possible
– Applications are collections of small and specialized functions (smaller than microservices)
– These specialized functions start up, do one thing well and then stop
– Applications run in stateless and ephemeral environments
– If applications architected to assume a clean and empty environment, they can run anywhere
– Every time they run: obtain needed data, do something, and then optionally store the result persistently or deliver the output to something else
– Everything is event-driven; consumption only occurs when needed
– Serverless should use FaaS products like Lambda where possible for compute functionality
– When not being used, serverless should be very close to zero cost until something in the environment generates an event (no persistent use of compute)
– Serverless should use managed services where possible (S3 for persistent object storage, DynamoDB for persistent data storage, third-party identity providers such as Google, Twitter, AD. Etc…)
Overall aim:
– Consume as a service whatever one can, code as little as possible, and use function as a service for any general purpose compute needs
– use all the building blocks together to create application
– No self-managed compute: no servers, no EC2 instances unless stated otherwise
Simple Notification Service
– Simple Notification Service is a key component of many architectures in AWS
– Highly Available, Secure, pub-sub messaging service
– Public AWS Service – network connectivity with public endpoint needed
– Coordinates the sending and delivery of messages
– Messages are payloads up to 256 kilobytes in size (not designed for large binary files)
– SNS topics are the base entity of SNS: permissions and configurations controlled and defined here
– A publisher sends messages to a TOPIC
– TOPICS have subscribers which receive messages (HTTP/S, Email(-JSON), Mobile Push, SMS Messages & Lambda)
– SNS offers Delivery Status – (Including HTTP, Lambda, SQS)
– SNS offers Delivery Retries – Reliable Delivery
– HA and Scalable within a Region
– SNS offers Server Side Encryption
– SNS offers Cross-Account access via TOPIC POLICY (resource policy applied to the topic)