This video was very helpful and got more info . Thanks
@karfin.trader3 жыл бұрын
Some information on how the backend queries will manage limit and offset would have been helpful to tie in the solution end to end.
@anothermouth70772 жыл бұрын
Same, at moment I'm making query string and based on given filters I conditionally appending where clauses. Could you let me know your approach?
@johnrodger54672 жыл бұрын
Can validate the request param in the api using a validation library, to only accept values in the allowed range. If the request is outside the range you can either return a response to the client telling them it's an invalid request, or send the request to the DB but with the max range on the query. Something like that. You could also write your own DB query wrappers/facades that have the limit already set there, and only use those in the application code rather than using the DB client directly.
@Shreenidhi11011 ай бұрын
thanks alot!I was struggling to anwer these questions in interview .I must say it's a easy way to understand these concepts.
@sidhanshuraghuvanshi1 Жыл бұрын
Expecting implementations of concepts as well in all videos
@UtkarshSinghPaliwal3 жыл бұрын
Please also make a few videos on Low Level Design and CDNs.
@rjcdz06 Жыл бұрын
Great and clear explanation 👏👏 Thanks a lot
@hakieye5649 Жыл бұрын
Wow terrific to the point with clear and clean message.
@buckybarnes91353 жыл бұрын
by your presentation we easily got the concepts, thanks to your editor😅😅
@halconElectrico2 жыл бұрын
Your explainations are the best, right to the point, well illustrated, real world examples. Thank you.
@UtkarshSinghPaliwal3 жыл бұрын
Thanks a lot for these wonderful videos. I've become a better Engineer with the help of your videos. Keep up the awesome work 👏
@rahulsen0022 жыл бұрын
Found 2 channels useful so far .. Ur channel and another.. kudos
@aatiqaghazali78508 ай бұрын
Plz mention the other one
@rahulsen0028 ай бұрын
@@aatiqaghazali7850 Rahul nath
@LoayAl-Said-j8p6 ай бұрын
Thank you so much for the effort. appreciate it Loay from Egypt
@WOYGx10102 жыл бұрын
You did a great job with this video, thank you
@dragonlordsaviour70052 жыл бұрын
you're super underrated
@nocaoconstantino3555 Жыл бұрын
Great. Wonderful explanation.......
@utkarshconscious3 жыл бұрын
This is really wonderful explanation. I know its not in scope of this series but out of curiosity would you mind throwing some light on how backing code for pagination can be implemented? Will it use some sort of sorted cache from where it returns results based on offset and max limit or is there a better way to get this done?
@haseebalamrafiq58942 жыл бұрын
mam you explain awesome. Thanks
@m13m Жыл бұрын
In backend for offset and limit pagination we can use db limit and offset parameter while creating a query to fetch that many rows and this quite inefficient in certain scenarios. Keyset pagination which is quite efficient but can’t directly query a particular page. Either go forward or backward in rows with a particular limit.
@saurabhchopade38913 жыл бұрын
Dope quality Explanation.
@maniac14412 жыл бұрын
greatly explained
@nihal62903 жыл бұрын
Love this video. Can you please create a video dedicated to API Security? How do you secure an API?
@keshavsethi16102 жыл бұрын
just one word Awesome.
@jinalpatel91543 жыл бұрын
This is nice topic. Sometime I feel that pure REST approach is not suitable for business need. It mainly revolve around single entity but business application has complex need like to filter. Let's say for example Employee Belong to specific company and organization and there are multiple attribute associated with that and we have to pass multiple filter attribute. I feel that sometime pragmatic approach will make more sense and expose end-point like /search / filters etc will make more sense.
@saurabhchopade38913 жыл бұрын
Thanks for posting this one
@sergiothinks22 жыл бұрын
amazing video thank you!
@sudocode2 жыл бұрын
My pleasure!
@kw52182 жыл бұрын
Explaination is excellent please provide practical video if possible
@shashankshekhar27363 жыл бұрын
Amazing explanation
@iyakkaprivatelimited57352 жыл бұрын
This explanation is so valuable thank you for that , also I would like to suggest if possible to do a video demo with a limited paging server response for example : API like Zoho, or deluge code based API's , how to use the explained methods on a study case like this
@naveensharma9834 Жыл бұрын
Clear and crisp explanation but I've one question. Do we need to hit db for every request, Is it a good idea ? If not then what are the other ways we fetch x amount to data in once(certain threshold) and serve in 20-20 chunks ?
@m13m Жыл бұрын
Definitely we could fetch a threshold number of rows and warumup your cache and grab any new data only through but offset-limit pagination is quite inefficient imagine there is no cache is such case every single query of limit and offset you are hitting db grabbing all the rows and then applying limit and offset on them. Also if you are inserting new items as well there can be cases where you could have duplicate items among your list with offset-page pagination Other technique that could be useful keyset pagination where you can’t actually pass offset but can behaviour of pagination with previous and next page with a certain limit just that can’t jump to a particular page but definitely traverse them limit you have set at a time.
@erased19723 жыл бұрын
Very helpful video
@keaganferrao9 ай бұрын
Using an OFFSET for huge data will still be inefficient for MILLIONS of rows as the database still needs to skip all the rows specified by offset. I expected you to give a solution to this problem in this video as the title specified "millions".
@luxurymusic10512 жыл бұрын
hey i was asked a question where i told about offset for pagination, but interviewer told the data is added on api all the time, so when i call the next page , i might get the same data in the next offset as well coz new data was appended by time i clicked on next page, so how to handle such cases???
@II-ii2um2 жыл бұрын
simple function that checks if the previous data shown != the new data being shown this time? Source: Copy-Paste Buffers in Systems use this all the time to prevent the same shit from being copied and pasted over and over again... Have you figured out a better answer for this yet?
@akashrulz303 жыл бұрын
Thank you so much 🔥
@gurusamy4523 Жыл бұрын
Hi teacher thanks❤
@joe02122 жыл бұрын
Nice. Any video on cursor vs offset based pagination
@rahul21422 жыл бұрын
Mam have you created video on implementation?
@abhijitdixit15893 жыл бұрын
One more way to reduce payload is sending it back as a stream, can you share use case for the same? Could it be video/audio streaming?
@SangeeP2 ай бұрын
Could you show a sample pagination and filtering code for an e commerce site for more clarity .. Wondering how the offset limit works when the reasons body has 1000 + record s in that case for one request pay load how you return so many by setting the server side max limit 20 ?? TIA
@apothike3 жыл бұрын
On the server in every request we will be fetching all the data(from database) then paginating it right, assuming no caching is done??
@UtkarshSinghPaliwal3 жыл бұрын
No. We can write the DB query which take the limit and offset numbers as arguments and fetch only the required data from the Database.
@shailjakantupadhyay51833 жыл бұрын
We never do that, consider server contains trillion data in table if you fetch all the data then it will go down. Read @Utkarsh comment.
@AbhishekJain118 Жыл бұрын
You did not discuss this scenario: if client request for 100 items and server max-limit is 20, how client will be able to request items 20 to 39 in the next request? How client will set its offset ? I am assuming client logic should have offset=lastoffset+numberOfItemsReceived
@sudocode Жыл бұрын
That’s implied my friend.
@unmeshvpatil2 жыл бұрын
Does api works to show products which are on low prices due to price error listed on amazon or flipkart?
@javaeeguy3 жыл бұрын
Can you please cover REST API security also?
@gurucharans96292 жыл бұрын
Mam'm how could I understand my frontend before making backend server. If I created a registration page and login page are on different pages then it's important to make the same thing on the backed side. So, I will have to login and registration page (register, update, compare password pages) are on the different pages or same page in backed side.
@stephenselvaraj89603 жыл бұрын
Super :)
@chollangimanisha3148 Жыл бұрын
Hi,your explanation is good. I have issue with pagination. I using one azure api to get all items. In azure portal, 500 items are there but I am getting 200 items while querying api. I applied limit and offset as well but not working. Please help.
@cut-a-lyst3 жыл бұрын
can we send a json data in filter if filtering data is complex? I currently POST and json body for it currently
@UtkarshSinghPaliwal3 жыл бұрын
Generally, there sbould not be a payload associated with a GET request. For a POST request, filtration might not be something that is required in the usual scenarios.
@kunalshah2331 Жыл бұрын
What is there is no pagination.. the data is loaded based on the user scrolling the screen..
@kapilrules3 жыл бұрын
Hi Yogita In case of pagination are all responses for all pages cached at server side at once? And then they are dispatched to client page by page as per the request? If they are cached on Server side when will the cache cleared? Thank you for all your videos 🙏
@_tachyons3 жыл бұрын
This is unlikely, it is mostly implemented by directly executing query on database, caching layer is added to improve performance, but caching entire thing in the cache defeats the purpose of caching
@NamathuUla8 ай бұрын
Thank you for your video but there is some limitation in LIMIT and OFFSET. it will be huge cost involved for RU/s
@adeshgangwar35553 жыл бұрын
Hi I have a quick question. So if i have 50 orders fetched from api and are available in dom. Now i want to implement search the order by id. In this case shall I do a internal filter in the dataset or shall I fetched filtered data from api? What would be the best approach to do it?
@AjaSiva3 жыл бұрын
Fetch it from the api. You may not know what ids are there in the current data you fetched. So it can give no result too if searched by id. Also id's are indexed in databases. So fetch call is not that costly.
@praveenj31123 жыл бұрын
It's clear ..but there is more link to fetch more data in some pagination APIs
@typg932 жыл бұрын
how does this compare to graphQL?
@ChandanKumar-ou9fr3 жыл бұрын
Designing the APIs are fine, but how to implement such things? What is the right approach. Let's assume that I am building an ecommerce site and where from the database I want top 20 filtered items, how to do that in code? Thanks for the awesome content. PS: All theory and no code, makes jhony a dull boy 😉
@DeepakJangra-up8ek3 жыл бұрын
Critical: what if you request, say first 10 (sorted by latest) orders and then 1 new order received. Now if you request next page then 1 order (1st of second page) will be repeated because thats 11th order now (not 10th anymore). How can we fix that.
@_tachyons3 жыл бұрын
This is not necessarily a technology issue, this could be an expected behavior as well. But if you want more predictable behavior use cursor based pagination
@pranavbhat293 жыл бұрын
Is there any specific form of response code sent by the server when the limit set by the client in the query param is larger than the max limit set in the server. I was thinking if it will send either of 400 ( Bad request ) or 413 ( payload too large ), but again you get a response with valid set of items in the server. So it seems to use some specific 2XX code itself. Could you please suggest or throw some pointer on what that might be?
@UtkarshSinghPaliwal3 жыл бұрын
Probably a 422 would do.
@AjaSiva3 жыл бұрын
You can throw any status code😅
@sujan_kumar_mitra3 жыл бұрын
Is using OFFSET a good idea to skip resources? I have heard that using OFFSET in SQL can reduce the performance of DB as if there are a large no. of records, the DB has to pull the tuples from the disk but not include them in the RESULT SET
@yashkhandelwal99263 жыл бұрын
Are there any issues if we use post instead of get in this and send all the required data in requestBody rather than query params?
@_tachyons3 жыл бұрын
That will be violation of rest conventions, but if the params is too big, then you may have to use POST
@UtkarshSinghPaliwal3 жыл бұрын
Bad Practice
@sumanthkeith13 жыл бұрын
I have few questions on pagination. Can you explain about the page count. How to determine how many number of pages for each query. Say the query returned 90 rows, and if the results per page is 10. I need to show 9 pages (1 2 3 4 .. 9) 2. See this scenario. I have a query which returns 100 records and on top of that I need to apply some business logic and filter some data, so after filter I got 70 records. Now how pagination work when user click on page 2. (Point to be noted there might be thousands os records returned at a time for a query).
@UtkarshSinghPaliwal3 жыл бұрын
Pagination should be applied on the final records being exposed to the clients. In the case where only 70 records are accessible by the client, pagination should create only 7 pages in totality. Moreover, in these cases, the client should never know that there are actually 100 records on top of which a biz. logic filters them down to 70. Otherwise, this would be an abstraction leak.
@sumanthkeith13 жыл бұрын
@@UtkarshSinghPaliwal yup I agree. But my question is when I click on page two, should query the db get 100 and apply business logic again to filter and show the contents of next set of records?? If we do this there will be performance impact. One solution is to store the filtered logic and Show the 2 nd page and so on. Should we use Redis or java cache us my next question.
@UtkarshSinghPaliwal3 жыл бұрын
@@sumanthkeith1 That's a pretty decent problem statement. We need to paginate and we don't have the records to send back without applying some business logic. In this case I'd say to choose either of two things, may be not use pagination at all or cache the indexes of the records and some meta if required. I'm presuming that querying data more than once is very expensive so that logic is not an option. Now with both the cases suggested, two problems arise, one with both the paths. If no pagination used, data may not even fit in a single response in which case you may provide a download link instead. In the other case of caching, you'll have to deal with all the caching related issues like data consistency etc. So you'll have to choose either of the two evils depending on your particular costs and usage.
@gouravkumarshaw5467 Жыл бұрын
Thanks !!
@itsme_ry2 жыл бұрын
Nic mam
@AnikashChakraborty3 жыл бұрын
How do I get to know till what number should I make the pagination buttons? Because if I don't specify it then the next button will return an empty page sometime in other words the grt request will return an empty array
@goikarBaab3 жыл бұрын
When you receive paginated data, the resultset should also set total records , what is the pagesize. Once you have these two data point, you know which will be the last page
@kavinkumar60802 ай бұрын
how the client side decide total page count
@umangbehl81529 ай бұрын
nice
@venkatshk3 жыл бұрын
please cover sorting also
@pradeepcreations8669 Жыл бұрын
will this work for mongodb?
@andiamakaza243 жыл бұрын
U looks like NAIROBI of money heist 😀
@kumaramresh79053 жыл бұрын
actually i learned these terms pagination, limit, offset, filters while learning DBMS and i think they're more related to that that rest Api
@subee1286 ай бұрын
Thanks
@getthenetfishing7130 Жыл бұрын
Do you offer a service to integrate an API from my distributor to my website for orders and dropshipping
@mythiyen13863 жыл бұрын
CDN can you share
@hammerod Жыл бұрын
Thank u
@jagansiram25292 жыл бұрын
Didn't work.. getting complete result
@mainuddinali9561 Жыл бұрын
in this video u r looking lean
@rajeshpatil3690 Жыл бұрын
Nice explanation but only for a very primitive audience to understand. It does not contain any technical details on how it works or implemented . If you could add more details on server side services to map to your URI examples that would be helpful.
@sudocode Жыл бұрын
Sure, you can create a video on that and I will be happy to endorse it 😅