🎬No video for this question yet. The written answer is below.
Storage classes of S3.- How did you monitor your glue job?
- cloud watch custom events?
- How do you secure sensitive data in AWS?
- Explain data storage & metadata handling in Athena / Glue?
- Where does Amazon Athena store data?
📝 Answer
Interviewer:
Can you explain the different storage classes in Amazon S3?
Candidate:
So basically, when I think about S3 storage classes, I don’t just memorize them… I relate them to real-time cost optimization.
First, I would categorize them based on access patterns.
In my projects, frequently accessed data, like active datasets used in ETL pipelines, I store in S3 Standard. This gives low latency and high availability.
Then, for data that is accessed less frequently, like historical data, I use S3 Standard-IA or One Zone-IA. This helps reduce storage cost while still allowing quick access when needed.
For archival purposes, I use Glacier or Glacier Deep Archive. For example, in one project, old transaction data older than one year was moved to Glacier using lifecycle policies.
So basically, my approach is… hot data in Standard, warm data in IA, and cold data in Glacier.
One important thing I learned is to use lifecycle rules effectively. That way, data automatically moves between storage classes without manual effort.
Interviewer:
How did you monitor your AWS Glue jobs? Did you use CloudWatch or custom events?
Candidate:
So basically, monitoring Glue jobs is something I handled carefully in production.
First, I relied on CloudWatch logs. Every Glue job automatically pushes logs there, so I used that to debug failures.
But just logs were not enough for proactive monitoring.
So what I did was… I configured CloudWatch metrics and alarms. For example, if a job fails or takes longer than expected, an alert is triggered.
In one of my projects, I integrated CloudWatch with SNS so that whenever a job failed, the team would receive an email notification immediately.
Also, I used Glue job bookmarks and job run history to track incremental processing.
Now coming to custom events… yes, I used them for advanced monitoring.
For example, after a Glue job completes, I triggered an EventBridge event which then invoked a Lambda function. That Lambda function would update status in a tracking table or notify downstream systems.
So basically, I combined CloudWatch for monitoring and EventBridge for event-driven workflows.
Interviewer:
How do you secure sensitive data in AWS?
Candidate:
This is a very important aspect, especially in data engineering.
So first, I always think in terms of layers of security.
At the storage level, I use encryption. For example, in S3, I enable server-side encryption using KMS keys.
In transit, I ensure data is transferred over HTTPS.
Then comes access control. I use IAM roles and policies to restrict access. For example, only specific Lambda functions or Glue jobs can access certain buckets.
In one of my projects, I handled PII data. So I implemented column-level masking before storing data.
Also, I used Secrets Manager to store database credentials instead of hardcoding them.
Another important practice I follow is auditing. Using CloudTrail, I track who accessed what data.
So basically, security is not just one thing… it’s encryption, access control, secrets management, and monitoring combined.
Interviewer:
Can you explain data storage and metadata handling in Athena and Glue?
Candidate:
So basically, Athena and Glue work together, and I’ve used this combination a lot.
First, the actual data is stored in S3. Athena does not store data itself. It just queries data directly from S3.
Now metadata… that’s where Glue Data Catalog comes in.
Glue Data Catalog stores table definitions, schema, partitions, and locations of data in S3.
In my project, I used Glue Crawlers to automatically scan S3 data and create tables in the catalog.
Then Athena queries those tables using SQL.
So basically, S3 stores the data, and Glue stores metadata.
One challenge I faced was schema mismatch when new data arrived. So I configured crawlers properly and sometimes used schema evolution techniques.
Interviewer:
Where does Amazon Athena store data?
Candidate:
So this is a tricky question, and I’ve seen many people misunderstand this.
Athena does not store data. It is a query service.
The actual data is stored in S3.
However, Athena does store query results. When we run a query, the output is stored in a specified S3 bucket.
In my project, I configured a separate S3 path for query results to keep things organized.
So basically, data is in S3, metadata is in Glue Catalog, and query results are also stored in S3.
Interviewer (Follow-up):
Good explanation. Can you explain how partitioning in S3 improves Athena query performance?