API Pagination Implement scalable pagination strategies for handling large datasets efficiently. Pagination Strategies | Strategy | Best For | Performance | |----------|----------|-------------| | Offset/Limit | Small datasets, simple UI | O(n) | | Cursor | Infinite scroll, real-time | O(1) | | Keyset | Large datasets | O(1) | Offset Pagination Cursor Pagination Response Format Best Practices - Set reasonable max limits (e.g., 100) - Use cursor pagination for large datasets - Index sorting fields - Avoid COUNT queries when possible - Never allow unlimited page sizes ---