Operational Excellence, Data Security and Governance on AWS
Modern data engineering is not just about building ETL pipelines and storing data. Production data platforms must also be reliable, observable, secure, compliant, and cost-efficient.
The AWS Certified Data Engineer – Associate (DEA-C01) certification evaluates these capabilities through two important domains:
Domain 3 – Data Operations and Support: 22% of scored content.
Domain 4 – Data Security and Governance: 18% of scored content.
This guide explores both domains through practical scenarios and AWS services.
Author Certification
AWS Certified Data Engineer – Associate (DEA-C01)
Successfully completed the AWS Certified Data Engineer – Associate certification, demonstrating knowledge of data ingestion, transformation, data storage, data operations, analytics, security, and governance using AWS services.
Certification Verification: View AWS Certification Badge on Credly
Part 1: Domain 3 – Data Operations and Support (22%)
Domain 3 focuses on operating data pipelines, analyzing data, monitoring workloads, troubleshooting failures, and maintaining data quality.
It contains four major tasks:
Automate data processing using AWS services.
Analyze data using AWS services.
Maintain and monitor data pipelines.
Ensure data quality.
1. Automating Data Processing
A production data platform may involve multiple services:
Amazon S3 for data storage.
AWS Glue for ETL.
Amazon Athena for analytics.
Amazon Redshift for data warehousing.
AWS Lambda for event-driven processing.
Amazon EventBridge for scheduling.
AWS Step Functions or Amazon MWAA for orchestration.
AWS Step Functions
Step Functions orchestrates workflows across AWS services.
Example workflow:
Receive a new data file.
Validate the file using Lambda.
Execute an AWS Glue ETL job.
Run data-quality checks.
Load the transformed data into Redshift.
Send a notification when processing completes.
Important concepts:
Retry: Handles temporary failures.
Catch: Handles errors and routes execution to another state.
Timeout: Limits execution duration.
Parallel: Executes independent branches simultaneously.
Map: Processes collections of records or items.
Use Step Functions when a workflow requires managed orchestration, conditional execution, retries, and service integrations.
Amazon MWAA
Amazon Managed Workflows for Apache Airflow provides managed Apache Airflow for scheduling and orchestrating complex workflows.
Important concepts:
DAGs (Directed Acyclic Graphs).
Operators.
Tasks and dependencies.
Sensors.
Scheduling.
Retries and execution monitoring.
Example:
from datetime import timedelta
from airflow.operators.python import PythonOperator
task = PythonOperator(
task_id="extract_data",
python_callable=extract_data,
retries=3,
retry_delay=timedelta(minutes=5)
)Step Functions vs MWAA
| Feature | Step Functions | MWAA |
|---|---|---|
| Technology | AWS-managed workflow service | Managed Apache Airflow |
| Workflow definition | State machines | Python DAGs |
| Best suited for | AWS service orchestration | Complex data workflows |
| Infrastructure management | Minimal | Managed Airflow environment |
| Integrations | AWS service integrations | Airflow operators and providers |
AWS SDK – Boto3
Boto3 allows Python applications to interact with AWS services.
Example: Start an AWS Glue job programmatically.
import boto3
glue = boto3.client(
"glue",
region_name="ap-south-1"
)
response = glue.start_job_run(
JobName="retail-orders-incremental-v2"
)
print(response["JobRunId"])Common SDK operations include:
Starting Glue jobs.
Reading S3 objects.
Querying DynamoDB.
Invoking Lambda.
Accessing Secrets Manager.
Use IAM roles rather than hardcoding AWS access keys.
AWS Lambda for Data Processing
Lambda is a serverless compute service used to automate event-driven processing.
Common triggers:
S3 object creation.
DynamoDB Streams.
Kinesis Data Streams.
EventBridge events.
API Gateway requests.
Example:
An incoming file arrives in S3. An S3 event triggers Lambda, which validates the file and starts a Glue ETL job.
An important design consideration is idempotency.
S3 event notifications provide at-least-once delivery. The same event can be delivered more than once.
Idempotent processing ensures that duplicate events do not create duplicate business results.
Amazon EventBridge
EventBridge manages event-driven integrations and scheduled execution.
Example:
A Glue job must run every day at 6 AM.
EventBridge Scheduler can invoke the Glue job on the required schedule.
Remember:
EventBridge Scheduler: Time-based and one-time scheduling.
EventBridge Rules: Event-pattern matching and scheduled rules.
Lambda: Executes application logic.
Step Functions: Orchestrates multi-step workflows.
Consuming and Maintaining Data APIs
Data engineers frequently consume external REST APIs.
Common HTTP methods:
| Method | Purpose |
|---|---|
| GET | Retrieve data |
| POST | Create data |
| PUT | Replace a resource |
| PATCH | Partially update a resource |
| DELETE | Remove a resource |
Example:
import requests
response = requests.get(
"https://api.example.com/customers",
timeout=30
)
response.raise_for_status()
data = response.json()For large datasets, APIs may implement pagination.
Common approaches:
Offset-based pagination.
Page-based pagination.
Cursor-based pagination.
Also consider authentication, API rate limits, retries, timeouts, error handling, and incremental extraction.
AWS Glue DataBrew and SageMaker Data Wrangler
AWS Glue DataBrew provides a visual interface for data preparation.
Common operations:
Remove duplicate records.
Handle missing values.
Standardize dates.
Normalize text.
Profile datasets.
Apply visual transformation recipes.
Amazon SageMaker Data Wrangler supports visual data preparation for machine learning workflows.
| Service | Main purpose |
|---|---|
| Glue DataBrew | General-purpose visual data preparation |
| SageMaker Data Wrangler | ML-oriented data preparation |
| AWS Glue ETL | Serverless ETL processing |
2. Analyzing Data Using AWS Services
Amazon Athena
Athena is a serverless query service used to analyze data stored in S3 using SQL.
Example:
SELECT
city,
SUM(order_amount) AS total_sales
FROM orders
GROUP BY city;Important optimization techniques:
Use Parquet or ORC instead of large CSV datasets where appropriate.
Partition datasets by frequently filtered columns.
Use compression.
Avoid SELECT * when unnecessary.
Apply partition filters.
Reduce small-file overhead.
Athena Notebooks with Apache Spark
Athena notebooks support interactive data exploration using Apache Spark.
Example:
df = spark.read.parquet(
"s3://retail-data-engineering-datablogs/curated/orders/"
)
df.groupBy("city").sum("order_amount").show()Use Athena SQL for SQL-based analysis and Athena Spark notebooks for interactive PySpark transformations and exploration without provisioning an EMR cluster.
Amazon QuickSight
QuickSight is AWS's business intelligence service for interactive dashboards and visualization.
Important concepts:
SPICE: In-memory engine for faster dashboard performance.
Direct Query: Queries the underlying data source.
Analyses: Workspaces for creating visualizations.
Dashboards: Published visualizations.
Row-level security: Restricts which rows users can view.
SPICE vs Direct Query
| Feature | SPICE | Direct Query |
|---|---|---|
| Data location | Imported into SPICE | Remains in source |
| Performance | Generally faster | Depends on source |
| Refresh | Scheduled or manual | Queries source |
| Suitable for | Fast dashboards | Frequently changing data |
SQL Analytics Concepts
Data engineers must understand several analytical operations.
Aggregation
SELECT
customer_id,
SUM(order_amount) AS total_amount
FROM orders
GROUP BY customer_id;Rolling average
SELECT
order_date,
daily_sales,
AVG(daily_sales) OVER (
ORDER BY order_date
ROWS BETWEEN 6 PRECEDING AND CURRENT ROW
) AS rolling_avg
FROM daily_revenue;This calculates a seven-row rolling average. It represents seven calendar days when there is exactly one row per day.
Pivoting
PIVOT converts rows into columns to compare values across categories.
Unpivoting
UNPIVOT converts columns into rows.
Provisioned vs Serverless
| Feature | Provisioned | Serverless |
|---|---|---|
| Infrastructure | Capacity is provisioned | Infrastructure managed by AWS |
| Scaling | Manual or configured | Automated where supported |
| Best suited for | Predictable workloads | Variable workloads |
| Capacity | Allocated resources | Usage-based capacity model |
For Amazon Redshift:
Provisioned: Redshift clusters and node types.
Serverless: Redshift workgroups and RPUs.
Choose according to workload predictability, performance, control, and cost requirements.
3. Maintaining and Monitoring Data Pipelines
Monitoring is essential for production data engineering.
A reliable monitoring architecture combines:
Amazon CloudWatch.
CloudWatch Logs.
CloudTrail.
Amazon SNS.
EventBridge.
AWS Config.
Amazon CloudWatch
CloudWatch collects metrics, logs, and events for monitoring AWS resources and applications.
Common monitoring activities:
Glue job execution duration.
Lambda errors and duration.
EMR cluster resource utilization.
Redshift performance.
EC2 CPU and memory-related metrics.
Application error rates.
CloudWatch Logs
CloudWatch Logs stores application and service logs.
Example query using CloudWatch Logs Insights:
fields @timestamp, @message
| filter @message like /ERROR/
| sort @timestamp desc
| limit 100This helps investigate application failures and transaction-related errors.
CloudWatch Alarms and SNS
Example: A Glue ETL job fails and the data engineering team needs an email notification.
A monitoring solution can use:
EventBridge Glue job state-change events.
SNS email subscriptions.
CloudWatch alarms for supported metrics and threshold-based monitoring.
SNS distributes notifications to subscribed endpoints.
AWS CloudTrail
CloudTrail records AWS API activity.
It helps answer:
Who modified a Glue job?
Who changed an S3 bucket policy?
Who called ModifyDBInstance?
When was a resource modified?
Which API operation was performed?
CloudTrail is important for security auditing and traceability.
AWS Config
AWS Config records resource configurations and evaluates compliance.
Examples:
Identify S3 buckets without required encryption.
Check EBS volume encryption.
Monitor RDS encryption configuration.
Review security group configuration.
Investigate historical resource changes.
AWS Config Rules can mark resources as COMPLIANT or NON_COMPLIANT.
AWS Systems Manager Automation can be used for configured remediation actions.
AWS Config vs CloudTrail vs CloudWatch
| Requirement | Service |
|---|---|
| Track who modified a resource | CloudTrail |
| Review historical resource configurations | AWS Config |
| Evaluate resource compliance | AWS Config |
| Monitor application performance | CloudWatch |
| Query application logs | CloudWatch Logs Insights |
| Send notifications | SNS |
| Centralize AWS configuration compliance | Config Aggregator |
EMR and Glue Troubleshooting
Common Glue and EMR problems include:
Insufficient worker capacity.
Memory errors.
Disk-space exhaustion.
Slow Spark stages.
Data skew.
Shuffle bottlenecks.
Schema mismatches.
Failed connections.
IAM permission problems.
For Spark workloads, investigate:
Executor utilization.
Stage duration.
Shuffle read/write.
Task failures.
Skewed partitions.
Memory pressure.
Local disk utilization.
Data skew occurs when records are distributed unevenly across partitions.
Possible mitigation techniques:
Repartitioning.
Key salting.
Broadcast joins for sufficiently small datasets.
Filtering unnecessary records before joins.
Adaptive Query Execution where supported.
4. Ensuring Data Quality
Data quality is essential for reliable analytics.
Important dimensions include:
Completeness.
Accuracy.
Consistency.
Validity.
Uniqueness.
Timeliness.
Data Quality Checks
Example:
from pyspark.sql.functions import col
valid_df = df.filter(
col("customer_id").isNotNull() &
col("order_id").isNotNull() &
(col("order_amount") > 0)
)This filters records with missing identifiers or invalid order amounts.
Other useful checks:
Duplicate detection.
Null checks.
Date validation.
Referential integrity.
Accepted-value checks.
Record-count reconciliation.
DataBrew Quality Rules
DataBrew supports visual data profiling and quality analysis.
Examples:
Check for missing values.
Identify duplicate records.
Validate data formats.
Identify inconsistent values.
Investigate unusual distributions.
Data Sampling Techniques
Sampling helps inspect large datasets without analyzing every record manually.
Common approaches:
Random sampling.
Stratified sampling.
Systematic sampling.
Cluster sampling.
Use stratified sampling when important categories or groups must be represented in the sample.
Data Skew
Data skew happens when a small number of partitions contain a disproportionately large amount of data.
It can cause long-running Spark tasks and uneven resource utilization.
Techniques such as repartitioning, salting, and broadcast joins can help.
Part 2: Domain 4 – Data Security and Governance (18%)
Domain 4 focuses on protecting data throughout its lifecycle.
It covers five major tasks:
Apply authentication mechanisms.
Apply authorization mechanisms.
Ensure data encryption and masking.
Prepare logs for audit.
Understand data privacy and governance.
1. Authentication Mechanisms
Authentication verifies the identity of a user, application, or AWS service.
AWS IAM
IAM manages identities and access to AWS resources.
Important components:
IAM Users.
IAM Groups.
IAM Roles.
IAM Policies.
Trust Policies.
Service-linked roles.
IAM Roles for AWS Services
Applications should use IAM roles instead of hardcoded access keys.
Example:
A Lambda function needs to read files from S3 and start a Glue job.
Assign an execution role with the required permissions.
The Lambda function can then access AWS services through temporary credentials.
IAM Policy Structure
Example policy allowing read-only access to a specific S3 bucket:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::retail-data-engineering-datablogs/*"
}
]
}Always follow the principle of least privilege.
Security Groups and VPC
Security groups act as virtual firewalls for supported AWS resources.
Example:
A private RDS database should allow inbound database traffic only from the application security group, rather than from the entire internet.
Important concepts:
Inbound rules.
Outbound rules.
Source security groups.
CIDR ranges.
Least-privilege network access.
AWS Secrets Manager
Secrets Manager securely stores and manages credentials.
Use cases:
Database usernames and passwords.
API credentials.
Application secrets.
Automated secret rotation.
Example:
An application retrieves database credentials from Secrets Manager rather than storing passwords in source code.
Systems Manager Parameter Store
Parameter Store stores configuration values and secrets.
| Feature | Secrets Manager | Parameter Store |
|---|---|---|
| Primary purpose | Secret management | Configuration and parameter management |
| Secret rotation | Built-in rotation integrations | Custom automation may be needed |
| Secure storage | Encryption with KMS | SecureString supports KMS encryption |
| Typical use | Database credentials | Application configuration and parameters |
Managed vs Unmanaged Services
Managed services reduce infrastructure administration by delegating operational responsibilities to AWS.
Examples:
Amazon RDS.
Amazon Redshift Serverless.
Amazon MWAA.
Unmanaged or self-managed services require more responsibility for operating the infrastructure.
Examples:
Self-managed databases on EC2.
Self-managed Hadoop clusters.
Managed services do not remove the customer's responsibility for identity, access, data protection, and configuration.
2. Authorization Mechanisms
Authorization determines what an authenticated identity is allowed to access.
IAM Policies
IAM policies define allowed or denied AWS actions against resources.
Important policy concepts:
Effect: Allow or Deny.
Action: AWS operation.
Resource: Target AWS resource.
Condition: Additional evaluation requirements.
An explicit Deny overrides an Allow.
Principle of Least Privilege
Grant only the permissions necessary to complete a task.
Example:
A reporting user may need Athena query access and read-only access to a specific S3 data prefix, but should not have permission to delete objects or modify production Glue jobs.
Database Roles and Permissions
Database-level authorization is separate from IAM authorization.
For example, a Redshift user can be granted SELECT permission on a particular table.
GRANT SELECT
ON TABLE retail.orders
TO reporting_user;IAM controls AWS service access; database permissions control access inside the database.
AWS Lake Formation
Lake Formation centrally manages permissions on data lakes.
It supports permissions at different levels:
Database.
Table.
Column.
Row.
Cell, where supported.
It can integrate with:
Amazon S3.
AWS Glue Data Catalog.
Amazon Athena.
Amazon Redshift.
Amazon EMR.
RBAC, ABAC and Tag-Based Access
Role-Based Access Control (RBAC)
Permissions are assigned according to roles.
Example: Finance analyst, data engineer, and administrator.
Attribute-Based Access Control (ABAC)
Access decisions use attributes such as department, project, or environment.
Example: A user with Department=Finance may access finance-related resources.
Tag-Based Access
Resource tags can be used in IAM policies and Lake Formation LF-Tags to implement access-control strategies.
Custom Policies and Least Privilege
Use custom policies when managed policies do not meet specific business requirements.
Avoid broad permissions such as s3:* on every bucket unless there is a justified operational requirement.
3. Data Encryption and Masking
Data security must cover data at rest and data in transit.
AWS Key Management Service (KMS)
KMS creates and manages cryptographic keys used to protect data.
Important concepts:
Customer managed keys.
AWS managed keys.
AWS owned keys.
Key policies.
Grants.
Key rotation.
Cross-account key access.
Encryption at Rest
Examples:
S3 SSE-S3.
S3 SSE-KMS.
EBS encryption.
RDS encryption.
Redshift encryption.
Encryption protects stored data from unauthorized access to the underlying storage.
Encryption in Transit
Encryption protects data while it moves between systems.
Common mechanisms:
HTTPS.
TLS.
SSL/TLS database connections.
Encrypted API communication.
For example, applications should connect to databases using encrypted connections where supported.
Cross-Account Encryption
Sharing encrypted data between AWS accounts requires correct permissions.
For SSE-KMS encrypted S3 objects, consider:
S3 bucket policy.
IAM permissions.
KMS key policy.
Cross-account KMS permissions.
Destination-account access requirements.
An S3 permission alone may not be sufficient when the object is encrypted with a customer-managed KMS key.
Data Masking and Anonymization
Data masking hides sensitive information.
Example:
Original:
selva@example.com
Masked:
se****@example.com
Common techniques:
Static masking.
Dynamic masking.
Tokenization.
Pseudonymization.
Anonymization.
Use masking when users need access to data for analysis but should not see the original sensitive values.
4. Preparing Logs for Audit
Logging provides visibility into user activity, application operations, and data access.
AWS CloudTrail
CloudTrail tracks AWS API activity.
Examples:
CreateBucket.
PutBucketPolicy.
StartJobRun.
ModifyDBInstance.
AssumeRole.
CloudTrail supports auditing and security investigations.
CloudTrail Lake
CloudTrail Lake provides a managed environment for collecting, storing, and querying CloudTrail event data using SQL.
It is useful for centralized audit investigations.
CloudWatch Logs
CloudWatch Logs stores application logs and supported service logs.
It helps investigate:
ETL errors.
Lambda execution failures.
Application exceptions.
Processing failures.
Operational events.
Athena for Log Analysis
Athena can query log files stored in S3.
Example:
SELECT
eventsource,
eventname,
COUNT(*) AS event_count
FROM cloudtrail_logs
GROUP BY eventsource, eventname
ORDER BY event_count DESC;OpenSearch Service
Amazon OpenSearch Service supports search, indexing, and analysis of large volumes of operational and application logs.
It can be useful for log investigation and visualization.
Logging Architecture
A typical centralized logging architecture:
CloudTrail records AWS API activity.
CloudWatch Logs captures application logs.
Logs are delivered or exported to S3.
Athena analyzes archived logs.
OpenSearch supports searchable operational log analysis.
CloudTrail Lake supports centralized SQL-based audit queries.
5. Data Privacy and Governance
Data governance ensures that data is properly classified, protected, accessed, shared, and retained.
Amazon Macie
Amazon Macie discovers and helps protect sensitive data stored in S3.
It can identify sensitive information such as:
Personal information.
Financial information.
Certain credentials and secrets.
Other sensitive data patterns.
Macie is particularly useful for discovering PII in data lakes.
PII Identification
PII means Personally Identifiable Information.
Examples:
Name.
Email address.
Phone number.
Government identification numbers.
Financial account information.
A typical data-governance process:
Discover datasets.
Identify sensitive columns.
Classify data.
Define access permissions.
Apply masking or encryption.
Monitor access.
Review retention and deletion requirements.
Macie can discover sensitive information in S3, while Lake Formation can help control access to cataloged data.
Data Sovereignty and Region Restrictions
Data sovereignty refers to the legal and regulatory requirements governing where data is stored and processed.
Example:
A company may require customer data to remain in approved AWS Regions.
Consider:
S3 bucket Region.
Cross-Region Replication.
AWS Backup policies.
Database backups.
Disaster recovery locations.
Cross-Region data transfers.
KMS key availability and permissions.
Prevent unauthorized replication or backup to disallowed Regions by applying suitable IAM policies, service policies, and organizational controls.
AWS Config
AWS Config records configuration changes and evaluates resources against compliance rules.
Example:
A company requires all RDS databases to be encrypted.
A managed AWS Config rule can identify noncompliant RDS resources.
Important components:
Configuration Recorder.
Configuration Items.
Configuration History.
Configuration Snapshots.
Managed Rules.
Custom Rules.
Conformance Packs.
Config Aggregators.
Remediation Actions.
AWS Config can work with Systems Manager Automation to remediate supported noncompliant resources.
Redshift Data Sharing
Amazon Redshift data sharing allows data to be shared across Redshift environments without necessarily copying the underlying data.
Important concepts:
Producer cluster or namespace.
Consumer cluster or namespace.
Data shares.
Databases created from shares.
Permission management.
This supports secure sharing of analytical datasets between teams and accounts.
SageMaker Catalog and Data Governance
Amazon SageMaker Catalog supports data discovery, cataloging, and governance workflows.
The exam guide also highlights access management through SageMaker Catalog projects.
Important governance concepts:
Data discovery.
Business metadata.
Ownership.
Classification.
Access requests.
Governance workflows.
Data lineage.
Governance Data Framework
A data governance framework defines how an organization manages data throughout its lifecycle.
Important areas:
Data ownership.
Data classification.
Access control.
Data quality.
Data lineage.
Privacy.
Retention.
Auditability.
Data sharing.
Regulatory compliance.
Part 3: Important Exam Comparisons
| Scenario | AWS service or feature |
|---|---|
| Who changed an AWS resource? | CloudTrail |
| What was the previous resource configuration? | AWS Config |
| Is a resource compliant? | AWS Config |
| Monitor Glue job performance | CloudWatch |
| Query application logs | CloudWatch Logs Insights |
| Centralized SQL queries on CloudTrail events | CloudTrail Lake |
| Find PII in S3 | Amazon Macie |
| Manage data lake permissions | AWS Lake Formation |
| Store database passwords | AWS Secrets Manager |
| Manage encryption keys | AWS KMS |
| Automate remediation | Systems Manager Automation |
| Send notifications | Amazon SNS |
| Visualize data | Amazon QuickSight |
| Analyze S3 data using SQL | Amazon Athena |
| Interactive PySpark analysis without EMR provisioning | Athena Spark notebooks |
| Complex AWS workflow orchestration | Step Functions |
| Apache Airflow orchestration | Amazon MWAA |
Part 4: Practical Learning Projects
The following exercises can help reinforce both domains.
Project 1: Production Pipeline Monitoring
Build a monitoring solution for an AWS Glue pipeline.
Monitor job execution.
Review CloudWatch Logs.
Configure failure notifications.
Track API calls with CloudTrail.
Investigate performance bottlenecks.
Project 2: AWS Config Compliance
Enable the Config recorder.
Record S3 resource configurations.
Create S3 encryption rules.
Review configuration history.
Explore remediation workflows.
Project 3: Data Security
Create a dedicated IAM role for data access.
Apply least-privilege S3 permissions.
Store database credentials in Secrets Manager.
Configure KMS encryption.
Review cross-account access requirements.
Project 4: Data Governance
Identify PII in S3 using Macie.
Configure Lake Formation permissions.
Explore LF-Tags.
Review Redshift data sharing.
Understand Region restrictions and data sovereignty.
Final Thoughts
Data engineering does not end when an ETL job succeeds.
A production-ready data platform must provide:
Reliable orchestration.
Effective monitoring.
Automated failure handling.
Data-quality validation.
Secure authentication.
Fine-grained authorization.
Encryption and masking.
Audit logging.
Privacy and governance.
Domain 3 focuses on operating and maintaining reliable pipelines, while Domain 4 focuses on protecting data and ensuring that it is governed responsibly.
For the AWS Certified Data Engineer – Associate exam, focus on selecting the right AWS service for each scenario rather than memorizing service definitions.
Build it. Monitor it. Secure it. Govern it.
0 Comments