0
0
Apache Airflowdevops~20 mins

Database backend optimization in Apache Airflow - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Airflow Database Optimization Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Airflow's Database Backend Role

What is the primary role of the database backend in Apache Airflow?

ATo store metadata about DAG runs, task instances, and scheduling information
BTo execute the tasks defined in DAGs
CTo serve the Airflow web UI pages to users
DTo manage the worker nodes and their resource allocation
Attempts:
2 left
💡 Hint

Think about where Airflow keeps track of what tasks ran and when.

💻 Command Output
intermediate
1:00remaining
Checking Airflow Database Connection Status

What is the output of the command airflow db check when the database connection is healthy?

Apache Airflow
airflow db check
ADatabase connection successful
BDatabase connection failed: timeout error
CDatabase schema version mismatch
DSyntax error: invalid command
Attempts:
2 left
💡 Hint

Look for a positive confirmation message.

Configuration
advanced
2:00remaining
Optimizing Airflow Database Performance

Which configuration change in airflow.cfg helps reduce database load by limiting the number of task instances fetched per query?

Aset <code>webserver.workers = 10</code>
Bset <code>core.parallelism = 1000</code>
Cset <code>scheduler.max_tis_per_query = 100</code>
Dset <code>scheduler.heartbeat_interval = 5</code>
Attempts:
2 left
💡 Hint

Focus on scheduler settings that control database queries.

Troubleshoot
advanced
2:00remaining
Diagnosing Slow Airflow Scheduler Due to Database

The Airflow scheduler is running slowly. Which database-related issue is most likely causing this?

AIncorrect DAG file permissions
BInsufficient worker nodes to run tasks
CWebserver port conflict causing UI delays
DExcessive number of rows in the task_instance table without cleanup
Attempts:
2 left
💡 Hint

Think about what happens if the database grows too large.

Best Practice
expert
2:30remaining
Best Practice for Airflow Database Maintenance

Which practice is best to keep the Airflow metadata database optimized and prevent performance degradation?

AIncrease the number of scheduler threads without limit
BRegularly run <code>airflow db cleanup</code> or use the built-in database cleanup DAG
CDisable database connection pooling to avoid stale connections
DStore all logs in the database instead of external storage
Attempts:
2 left
💡 Hint

Think about how to keep the database size manageable.