I am thinking to use AWS API Gateway and AWS Lambda(Python) to create a serverless API's , but while designing this i was thinking of some aspects like pagination,security,caching,versioning ..etc
so my question is: What is the best approach performance & cost wise to implement API pagination with very big data (1 million records)?
- should i implement the pagination in postgresql db? (i think this would be slow)
- should i not use postgresql db pagination and just cache all the results i get from db into aws elastic cache and then do server side pagination in lambda.
I appreciate your help guys.