Skip to content

Latest commit

 

History

History
43 lines (22 loc) · 1.98 KB

File metadata and controls

43 lines (22 loc) · 1.98 KB

🎤 Interview Q&A - Lab 09: Job Registry with PostgreSQL

Below are focused questions and answers based on the concepts, implementation steps, and validation performed in this lab.

1. What problem does a job registry solve?

It centralizes metadata for background or scheduled jobs so operators can track state changes, timestamps, outputs, and failures in one place.

2. Why was PostgreSQL used in this lab?

PostgreSQL provides structured persistence, strong SQL querying, JSONB storage, indexing, and transactional updates that fit job lifecycle tracking well.

3. What statuses were enforced in the jobs table?

The schema limited status values to pending, running, completed, and failed through a CHECK constraint.

4. Why is result_data stored as JSONB?

JSONB makes it easy to persist flexible structured results such as processed record counts, summary data, or task-specific output without redesigning the schema each time.

5. What is the purpose of started_at and completed_at?

Those timestamps support runtime visibility, duration measurement, and historical execution analysis.

6. Why did the job manager use transactions and rollback handling?

Transactional control protects the integrity of job state changes so partial updates do not leave records in an inconsistent state.

7. What does get_jobs_by_status() enable?

It allows operators or automation systems to query job history by lifecycle state for reporting, retry queues, or troubleshooting.

8. How was failure information preserved?

The fail_job() method updated the job to failed, set completed_at, and stored a descriptive error_message in the database.

9. Why is duration calculation useful in operations work?

It helps compare run times, identify slow jobs, tune performance, and establish expected execution baselines.

10. How does this lab relate to production systems?

The same pattern appears in schedulers, workflow engines, orchestrators, and platform services that must track execution history reliably.