1 / 10

CS122B: Projects in Databases and Web Applications Winter 201 9

Learn about pagination, caching, sorting, searching, and browsing in databases and web applications. Explore examples and techniques for efficient data retrieval and display.

earthat
Download Presentation

CS122B: Projects in Databases and Web Applications Winter 201 9

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS122B: Projects in Databases and Web Applications Winter 2019 Professor Chen Li Department of Computer Science UC Irvine Notes 05: Pagination,Caching, Sort, Search, Browse

  2. Pagination • Showresultsindifferentpages

  3. SQLSupport SELECT columns FROM table LIMIT 20 OFFSET 10

  4. EmbeddingparametersinGETrequests Example: https://www.autotrader.com/cars-for-sale/Sedan/Irvine+CA-92604?zip=92604&startYear=1981&numRecords=25&sortBy=derivedpriceDESC&vehicleStyleCodes=SEDAN&firstRecord=0&endYear=2019&searchRadius=10

  5. Caching in Tomcat • Storethequeryresultsasanobject • Laterrequestscanbeservedusingthecachewithoutqueryingthedatabase

  6. Caching in Tomcat • Pros: • LesstrafficonDB • Lowresponsetime • Cons: • Memoryoverheadinwebserver • Resultsmaybeobsolete

  7. Searching/Browsing

  8. Different queries • Browsing: SELECT * FROM Movies, genres, genres_in_movies WHERE genres.name = “action” • Searching: SELECT * FROM Movies WHERE title LIKE “%term%”;

  9. Same page of movie list • Implement a Java Servlet program by taking a SQL query as a parameter • Show the results of the query as a list of movies.

  10. Sorting • Frontend GET request includes a sorting parameter such as “DESC” and “ASCE”; • Use “ORDER BY” in SQL to sort the results

More Related