API Design · Middle · Question 16 of 75
How can an API offer flexible filtering without becoming a query language nobody can optimize?
- 1Accept raw SQL in a query parameter
- 2Allow filtering on every field with every operator
- ✓Correct answer: Support a defined set of filterable fields and operators that are backed by indexes, and reject the rest
Explanation
Unbounded filters lead to slow queries and denial of service. Google's AIP-160 defines a constrained filter syntax.