Study guide
4.6 Resilient Streaming, Deployment & Asynchronous Processing
AWS Certified Generative AI Developer - Professional AIP-C01
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Overview & Foundation Model Fundamentals
1.1 AIP-C01 Exam Structure, Logistics & Passing Strategy 1.2 AIP-C01 Scoring & Professional Decision Strategy 1.3 Foundation Model Landscape & Model Selection on Amazon Bedrock 1.4 Model Abstraction, Controlled Switching & Resilience 1.5 Customization Spectrum: Prompting vs RAG vs Fine-Tuning vs Continued Pre-training 1.6 Custom Model Deployment & Lifecycle Management
2 Chapter 2: Bedrock Knowledge Bases & RAG Architectures
2.1 Managed RAG Architecture with Bedrock Knowledge Bases 2.2 Knowledge Source Integration, Synchronization & Freshness 2.3 Data Ingestion, Parsing & Chunking Strategies 2.4 Embedding Models & Vector Representations 2.5 Vector Index Scale, Migration & Retrieval Evaluation 2.6 Vector Database Selection: OpenSearch Serverless vs Aurora pgvector vs Managed Stores 2.7 Vector Store Security, Multi-Tenancy & Connectivity
3 Chapter 3: Advanced Vector Search, Indexing & Data Compliance
3.1 Hybrid Search, Metadata Filtering & Semantic Reranking 3.2 Metadata Filtering, Reranking & Query Transformation 3.3 Fine-Tuning & Continued Pre-Training Data Pipeline Engineering 3.4 Data Validation, Multimodal Processing & Model Formatting 3.5 Data Privacy, Data Residency & Compliance Governance 3.6 Privacy Preservation, Source Lineage & Audit Evidence
4 Chapter 4: Prompt Engineering & Bedrock Runtime APIs
4.1 Advanced Prompt Engineering Techniques & Inference Parameters 4.2 Inference Parameters, Prompt Governance & Regression 4.3 Converse API vs InvokeModel API & Message Formatting 4.4 Tool Calling, FM API Resilience & Model Routing 4.5 Streaming Architectures & Asynchronous Event Processing 4.6 Resilient Streaming, Deployment & Asynchronous Processing
5 Chapter 5: Amazon Bedrock Agents & Tool Integration
5.1 Agentic Architecture, ReAct Reasoning Loops & Orchestration 5.2 Agent Frameworks, MCP & Lifecycle Management 5.3 Action Groups, OpenAPI Schemas & AWS Lambda Integration 5.4 Agent Memory, Session State & Multi-Agent Collaboration Patterns 5.5 Persistent State & Multi-Agent Coordination 5.6 Advanced Agent Prompt Templates & Flow Customization 5.7 Agent Safeguards, Tool Reliability & Cost Control
6 Chapter 6: Workflow Orchestration & Application Integration
6.1 Amazon Bedrock Prompt Flows & Visual Orchestration 6.2 Step Functions Orchestration & Human-in-the-Loop Workflows 6.3 Enterprise Integration: API Gateway, AppSync, and EventBridge 6.4 Hybrid Integration, GenAI Gateways & CI/CD Tooling
7 Chapter 7: AI Safety & Guardrails for Amazon Bedrock
7.1 Guardrails Architecture, Denied Topics & Content Filters 7.2 Content Safety, Defense in Depth & Threat Detection 7.3 Sensitive Information Filters & PII Redaction/Masking 7.4 Contextual Grounding Checks & Hallucination Prevention
8 Chapter 8: Security, Access Control & Network Architecture
8.1 IAM Least Privilege & Resource Policies for Bedrock 8.2 PrivateLink VPC Endpoints & Network Isolation 8.3 Encryption with AWS KMS & Cross-Account Access Patterns
9 Chapter 9: Governance, Auditing & Operational Logging
9.1 SageMaker Model Cards & AI Governance Frameworks 9.2 Lineage, Fairness, Transparency & Continuous Governance 9.3 Invocation Logging, CloudTrail Auditing & Observability 9.4 Responsible AI, Bias Mitigation & Red Teaming Methodologies
10 Chapter 10: Performance, Throughput & Cost Optimization
10.1 On-Demand vs Provisioned Throughput & Capacity Planning 10.2 Capacity Measurement, Scaling Patterns & Resilience 10.3 Batch Inference & Bedrock Intelligent Prompt Routing 10.4 Intelligent Prompt Routing & Application Eligibility 10.5 Prompt Caching, Token Optimization & Latency Reduction
11 Chapter 11: Testing, Evaluation & Troubleshooting GenAI Solutions
11.1 Amazon Bedrock Model Evaluation (Automatic & Human Workflows) 11.2 Human, RAG & Continuous Evaluation 11.3 Evaluation Metrics & RAG Quality Benchmarking (Ragas, ROUGE, BLEU) 11.4 RAG and Agent Performance Evaluation 11.5 CloudWatch Metrics, Throttling & Operational Observability 11.6 Quota Diagnosis, Retry Control & Operational Troubleshooting 11.7 Troubleshooting Common GenAI Failure Modes & Agent Traces 11.8 Prompt Maintenance, Content Handling & Deployment Validation
4.6 Resilient Streaming, Deployment & Asynchronous Processing
Key Takeaways Explain This Topic AI
A streaming HTTP success can still end with a model or transport exception after partial output.
Use queues, correlation IDs, and idempotency for asynchronous model workflows.
Choose Bedrock, SageMaker, or containers from control, traffic, accelerator, and operational requirements.
Last updated: September 2026
- 4.6 Resilient Streaming, Deployment & Asynchronous Processing
- Handling Mid-Stream Errors & Connection Interruptions
Streaming architectures introduce unique failure modes that synchronous APIs do not encounter:
Mid-Stream Model Exceptions ( EventStreamError ) : An inference call may start successfully, stream 50 tokens, and then fail due to context window exhaustion or an internal runtime exception. In EventStream, this arrives as an exception frame mid-stream rather than an HTTP 500 status code (since the HTTP headers were already sent at connection initiation). Client libraries must catch exception events during stream iteration.
Guardrail Interventions Mid-Stream : If Amazon Bedrock Guardrails intervenes, the stream can end with a guardrail-related stop reason and configured blocked content. Clients must parse the documented event union and terminal status instead of assuming every successful HTTP handshake yields a normal completion.
Network Disconnections & Idempotency : If the client disconnects, record correlation and application state and decide whether to abandon or start a new invocation. Do not claim that an interrupted generation can resume from a Bedrock token offset or that a repeated model call avoids new inference charges.
Asynchronous Decoupled Architectures for Batch Workloads
While streaming addresses interactive real-time experiences, high-throughput asynchronous batch processing requires a completely decoupled serverless architecture. BATCH ARCHITECTURE:
- S3 Data Lake ──► Amazon Bedrock Batch Inference ──► S3 Output Bucket
- (JSONL Ingestion) (CreateModelInvocationJob) (50% Cost Discount)
- │
- ▼ EventBridge Event
- Downstream ETL Lambda
ORCHESTRATED STEP FUNCTIONS MAP:
- SQS Queue ──► Step Functions (Distributed Map) ──► Bedrock Invocation ──► DynamoDB/S3
- ├── Concurrency Control (MaxConcurrency: 50)
- └── Exponential Backoff on ThrottlingException
- 1. Amazon Bedrock Batch Inference ( CreateModelInvocationJob )
For offline workloads—such as summarizing 100,000 customer feedback tickets or categorizing catalog entries—synchronous invocations waste compute and trigger API rate throttling. Bedrock provides native Batch Inference :
Input : A JSON Lines ( .jsonl ) file in Amazon S3 where each line represents a single inference request payload matching the model schema.
Job Submission : Call CreateModelInvocationJob specifying the input S3 URI, output S3 URI, and IAM service role.
Pricing Advantage : AWS currently lists batch inference at 50% lower than on-demand pricing for select supported models; verify the selected model on the current pricing page.
Quota Planning : Batch jobs use their documented job and model quotas. Keep offline work out of the interactive request path, but monitor both paths instead of promising absolute isolation.
Completion Notification : Bedrock emits state change events to Amazon EventBridge when the batch job transitions to Completed or Failed , allowing downstream Lambdas to trigger post-processing automatically.
2. High-Throughput Orchestration with AWS Step Functions Distributed Map
When asynchronous workloads require multi-step logic (e.g., document parsing → \to → PII redaction → \to → Bedrock invocation → \to → vector indexing), AWS Step Functions Distributed Map provides the industry standard orchestration pattern:
Distributed Map State : Iterates over large datasets in S3, spawning up to 10,000 parallel execution workflows.
Concurrency Limits : MaxConcurrency bounds simultaneous child work. Staying within token- or request-rate quotas also requires measured task duration, pacing, and retry or admission controls.
Resilience and Retry : Native Retry configuration with exponential backoff handles transient Bedrock.ThrottlingException errors automatically: {
- "Type": "Task",
- "Resource": "arn:aws:states:::bedrock:invokeModel",
- "Parameters": {
- "ModelId": "anthropic.claude-3-5-sonnet-20241022-v2:0",
- "Body": {
- "messages": [{"role": "user", "content": [{"text": "Summarize this text."}]}],
- "max_tokens": 500
- }
- },
- "Retry": [
- {
- "ErrorEquals": ["Bedrock.ThrottlingException"],
- "IntervalSeconds": 2,
- "MaxAttempts": 5,
- "BackoffRate": 2.0
- }
- ],
- "Catch": [
- {
- "ErrorEquals": ["States.ALL"],
- "Next": "SendToDeadLetterQueue"
- }
- ]
- }
- Exam Scenarios & Common Traps
- Real-World Exam Scenario
A healthcare technology SaaS company provides an AI medical research summarizer for doctors. In production, users report that when generating complex 1,500-word meta-analysis summaries, the web portal sits on a blank loading spinner for up to 25 seconds before displaying any text. Furthermore, the current buffered API integration returns a timeout before the Lambda finishes.
Architecture Solution :
Transition the application backend from synchronous InvokeModel to streaming with ConverseStream .
Configure a supported API Gateway REST proxy integration with response transfer mode STREAM , or use a Lambda Function URL, WebSocket API, or AppSync subscription according to the client contract.
Configure the Lambda handler using awslambda.streamifyResponse , streaming contentBlockDelta chunks to the client browser over HTTP chunked transfer.
Result: Doctors see chunks as they become available; measure actual TTFT and total latency for the chosen path.
Common Architectural Traps
Trap 1: Assuming every API Gateway integration streams : REST response streaming requires a supported proxy integration and STREAM response transfer mode; merely enabling Lambda streaming is insufficient. HTTP APIs and WebSocket APIs have different semantics. Choose the path that satisfies authentication, timeout, cancellation, and client requirements.
Trap 2: Using interactive calls for a massive overnight batch : Eligible Bedrock Batch Inference models can use lower current batch pricing and an asynchronous job workflow. Confirm current model support, price, and quotas rather than asserting one rule for every model.
Trap 3: Misinterpreting Mid-Stream Errors as Network Drops : Treating stream terminations without checking the messageDelta or EventStream error frames. Applications must parse stopReason to identify whether generation halted due to max_tokens (truncation), content_filtered (safety guardrails), or an unhandled service exception.
Deployment patterns for large language models
Choose compute from traffic and control requirements. Bedrock on-demand invocation fits managed variable traffic; Provisioned Throughput fits supported sustained capacity; SageMaker AI endpoints fit teams that need model containers, accelerators, deployment variants, or custom inference stacks. Lambda can front short orchestration calls but does not host a large model inside the function. Containerized serving on ECS or EKS requires explicit GPU memory, model-loading, health-check, autoscaling, and patching design.
Large language models differ from small traditional models: weights can take minutes to load, accelerators are expensive, token generation is sequential, and input/output token lengths drive capacity. Use smaller specialized models or a cascade for routine tasks when evaluation proves quality. Keep rollback targets in a registry, warm capacity before traffic shifts, and validate failure behavior instead of assuming a container restart is instantaneous.