Week 3: Serverless Computing Flashcards

1
Q

What is utility computing?

A

Paying for computing resources as you use them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Utility premium and how does it factor into the decision for what model to use?

A

Utility Premium is the ratio of cloud cost (The cost per unit when renting from a cloud provider) to baseline cost (The cost per unit (e.g., per machine per day) if you own your own infrastructure.).

The cloud option becomes economical when:
Utility premium < (Peak Demand / Average Demand)
This reflects that if your demand is spiky (high peak relative to the average), the “pay-as-you-go” model saves money compared to provisioning for the peak every day.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the hybrid model of utility pricing?

A

owning baseline capacity for average needs and bursting into the cloud for peaks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the benefits of Cloud providers sharing Common Infrastructure?

A
  • Instead of overprovisioning to meet one customer’s peak demand (which might be low most of the time), sharing resources across multiple customers can smooth out demand, leading to higher overall utilization.
  • Better utilization reduces the cost per delivered resource. Even if a provider builds capacity to meet the highest possible demand, multiplexing ensures that idle capacity on one customer’s account can be used by another.
  • In cases where infrastructure is built below peak capacity (necessitating “cloud bursting”), sharing jobs can minimize lost revenue or SLA violation penalties.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Cv and how is interpreted in terms of smoothness?

A

Cv is defined as the ratio of the standard deviation of demand to its mean (Cv = σ/μ).
A lower Cv indicates smoother (less variable) demand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What implications does smoothness have on Infrastructure?

A
  • Facilities built for fixed capacity (e.g., owned data centers) are underutilized if demand is highly variable. Smoother workloads lead to better utilization of these fixed assets.
  • When demand is smooth, providers face lower penalties for overprovisioning (excess capacity) or underprovisioning (service interruptions).
  • Smoothing can be achieved by either increasing the average load or reducing the variability (standard deviation) through strategic aggregation of workloads.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you calculate Cv over n independent jobs

A

If you aggregate n independent jobs, each with the same mean (μ) and standard deviation (σ), the aggregate’s mean becomes n·μ and its standard deviation becomes √n·σ. The variability (relative to the mean) decreases by a factor of 1/√n. Thus, aggregating many independent jobs smooths out the overall demand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Cv vary with Correlated Jobs?

A

If jobs are positively correlated (they peak and dip together), the aggregate demand mirrors individual variability; hence, the Cv remains similar to that of a single job.
In a perfectly negative correlation scenario (e.g., if one job’s demand is high exactly when another’s is low, such as X and 1-X), the aggregate demand can be constant, yielding a Cv of 0. While this is theoretical, it illustrates the best-case scenario for smoothing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Serverless Architecture?

A

Serverless architecture is a cloud computing model in which you write your application as small, discrete functions (often called Function as a Service or FaaS) that are automatically triggered by events. The cloud provider manages all of the underlying infrastructure—including provisioning, scaling, and fault tolerance—so you can focus solely on your business logic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the Key Characteristics of Serverless Architecture?

A
  • Abstraction of Servers: No need to manage or provision servers manually.
  • Event-Driven: Functions are invoked by events (such as file uploads, database changes, or API calls).
  • Statelessness: Each function invocation is independent; any persistent state must be stored externally.
  • Fine-Grained Billing: You pay only for the compute time you use.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are Examples of Serverless Compute?

A

Function as a Service (FaaS):
AWS Lambda
Azure Functions
Google Cloud Functions
Container as a Service (in a serverless model):
While not pure FaaS, offerings like Amazon ECS/EKS and Google Cloud Run also abstract container management and can be used in event-driven architectures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are examples of Serverless Storage?

A

Blob/Object Storage:
Amazon S3
Azure Blob Storage
Google Cloud Storage
Key-Value / NoSQL Databases:
Amazon DynamoDB
Azure Cosmos DB
Google Cloud Datastore / Firestore

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is AWS Lambda?

A

AWS Lambda is Amazon’s serverless compute service. It allows you to run code (in languages like Python, Node.js, Java, etc.) in response to events without having to provision or manage servers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the key characteristics of Lambda?

A

Event-Driven Execution: The code (or “Lambda function”) is triggered by events such as changes in S3, updates in DynamoDB, or API calls through API Gateway.
Fully Managed: AWS automatically handles scaling, fault tolerance, and resource provisioning.
Cost Efficiency: You are billed only for the compute time you consume.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are possible Event Sources for AWS Lambda?

A

Amazon S3: File uploads or changes can trigger a Lambda function.
Amazon DynamoDB: Data modifications in tables can invoke functions.
Amazon API Gateway: HTTP requests (REST or WebSocket) can trigger Lambda.
Amazon Kinesis: Streamed data events.
Amazon CloudWatch: Scheduled events or system monitoring alerts.
Amazon SNS (Simple Notification Service): Notifications can serve as triggers.
Other AWS Services: Such as CloudFormation events and more.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are Constraints / Configuration Options for AWS Lambda?

A

Statelessness:
Lambda functions must be stateless; any persistent state needs to be stored in external services (like DynamoDB or S3).
Memory Allocation:
Configurable between 128 MB and 1.5 GB in 64 MB increments.
CPU Allocation:
The CPU power available to a function scales proportionally with the memory setting.
Temporary Storage:
Each function is provided with a 500 MB temporary storage space (located at /tmp), which is intended only for transient data during execution.
Timeout Settings:
The default timeout is 3 seconds, but you can configure it to run anywhere from 1 second up to 300 seconds.

17
Q

What are AWS Step Functions?

A

AWS Step Functions is a fully managed orchestration service that lets you build and run state machines to coordinate multiple AWS services into serverless workflows. By defining states, transitions, and tasks, it breaks complex processes into manageable steps.

18
Q

What are the benefits of Step Functions?

A

Improves Reliability: Makes error handling, retries, and compensation easier to configure.
Simplifies Debugging: Offers visual execution histories and step-by-step tracing.
Reduces Code Complexity: Offloads orchestration from individual AWS Lambda functions so that each function remains focused on its core task.

19
Q

What are Standard Workflows?

A

A type of Step Functions workflow designed for Long-running processes (lasting minutes, hours, or days). It has detailed execution history, per-step logging, and strong durability.

20
Q

What are Express Workflows?

A

A type of Step Functions workflow designed for high-volume, short-duration event processing. It has lower cost with the ability to handle tens of thousands of executions per second.

21
Q

When should you use Standard Workflows vs Express Workflows

A

Standard Workflows: You need full visibility for debugging and might include manual or time-consuming tasks.
Express Workflows: You need fast, cost-efficient processing for short tasks without the need for deep execution history.

22
Q

How do Step Functions integrate with AWS services?

A

AWS Lambda: Trigger functions to perform discrete tasks.
Amazon ECS and AWS Batch: Manage containerized tasks and batch processing.
DynamoDB, SNS, SQS: Directly interact with databases and messaging services.
External Workers: Use activities to incorporate processes running outside AWS (e.g., on EC2 or on-premises).

23
Q

What are some common use cases for Step Functions?

A

AWS Step Functions is widely used in scenarios that require robust orchestration:
- Chaining tasks such as data extraction, transformation, and loading into databases or data lakes.
- Coordinating multiple microservices to complete complex business processes.
- Managing long-running tasks that might require human intervention (e.g., approval workflows) with detailed audit trails.
- Automatically managing failures by retrying failed tasks or routing to alternate processes.

24
Q

What is AWS API Gateway?

A

AWS API Gateway is a fully managed service that acts as the “front door” for your applications to access data, business logic, or functionality from backend services.

25
What are the benefits of AWS API Gateway
- Provides a single endpoint for handling incoming requests and routing them to various backends. - Offers built-in features for authentication, authorization, and throttling. - Automatically scales to handle high volumes of concurrent API calls. - Manages tasks such as request transformation, caching, and monitoring, which reduces the need for custom infrastructure management.
26
What are the API types supported by API Gateway?
RESTful APIs: The traditional API style using HTTP methods like GET, POST, etc., suitable for most CRUD operations. HTTP APIs: A simpler, lower-cost option for building APIs with less configuration overhead. WebSocket APIs: Enables real-time, two-way communication for applications that require live updates (e.g., chat applications, live dashboards).
27
How does API Gateway integrate with AWS Services
AWS Lambda: Easily route API calls to Lambda functions, allowing serverless processing. HTTP Endpoints and EC2: Serve as a proxy to backend servers, whether they run on EC2, on-premises, or elsewhere. VPC Links: Securely connect to private resources within your Virtual Private Cloud. Mapping Templates: Transform requests and responses, enabling smooth integration with legacy systems or different data formats. Direct Service Integrations: Call AWS services directly (for example, via the AWS SDK) without needing intermediary Lambda functions.