Challenge - 5 Problems
Elasticsearch vs Relational Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Elasticsearch Query Result Count
Given the following Elasticsearch query on an index with 100 documents, 30 of which have the field
status set to active, what is the total hits count returned by this query?Elasticsearch
{
"query": {
"term": { "status": "active" }
}
}Attempts:
2 left
💡 Hint
The term query matches documents where the field exactly matches the given value.
✗ Incorrect
The term query filters documents with
status exactly equal to active. Since 30 documents have this field value, the total hits count is 30.🧠 Conceptual
intermediate2:00remaining
Data Model Differences
Which statement best describes a key difference between Elasticsearch and relational databases in how they store data?
Attempts:
2 left
💡 Hint
Think about how flexible the data format is in each system.
✗ Incorrect
Elasticsearch stores data as flexible JSON documents designed for fast search and analytics. Relational databases use structured tables with fixed columns and schemas.
🔧 Debug
advanced2:00remaining
Why Does This Elasticsearch Query Fail?
Consider this Elasticsearch query that tries to filter documents where
age is greater than 30:
{
"query": {
"range": {
"age": {
"gt": 30
}
}
}
}
Which option explains why this query might fail or return no results if age is stored as a text field in Elasticsearch?Attempts:
2 left
💡 Hint
Check the data type requirements for range queries in Elasticsearch.
✗ Incorrect
Range queries only work on numeric, date, or comparable fields. If
age is mapped as text, the query will not filter correctly.❓ Predict Output
advanced2:00remaining
Relational Database Join vs Elasticsearch Nested Query
In a relational database, joining two tables returns combined rows. Which Elasticsearch query type best mimics this behavior for nested objects within documents?
Attempts:
2 left
💡 Hint
Think about how Elasticsearch handles arrays of objects inside documents.
✗ Incorrect
The nested query allows searching within nested objects inside a document, similar to how joins combine related rows in relational databases.
🚀 Application
expert2:00remaining
Choosing Between Elasticsearch and Relational Databases
You need to build a system that supports complex transactions, strong data consistency, and structured reporting. Which database type is generally more suitable for this use case?
Attempts:
2 left
💡 Hint
Consider which system guarantees strong consistency and transactional support.
✗ Incorrect
Relational databases are designed for ACID compliance, ensuring strong consistency and transactional integrity, which is essential for complex transactions and structured reporting.