Using offset and page to paginate data would cause serious performance problem when there are quite a lot of data and offset is pretty large.
Usually we choose to paginate the data using filters like { id: { $gt: <id-of-the-last-retrieved-entity> } }, while the
offset and page param is still available, so that attackers may be able to make the back-end run slowly by sending requests like ?page=99999 or ?offset=999999
Using
offset
andpage
to paginate data would cause serious performance problem when there are quite a lot of data and offset is pretty large. Usually we choose to paginate the data using filters like{ id: { $gt: <id-of-the-last-retrieved-entity> } }
, while theoffset
andpage
param is still available, so that attackers may be able to make the back-end run slowly by sending requests like?page=99999
or?offset=999999