English subtitles

← Using Filters - Developing Scalable Apps with Java

Get Embed Code
4 Languages

Showing Revision 5 created 05/24/2016 by Udacity Robot.

  1. So let's have a look at some of the
  2. implications of using multiple filters. This one is a concern.
  3. Deployed apps must have composite indexes for all filter combinations.
  4. If you try to run a query for which the
  5. composite index does not exist, you will get an
  6. error. Your users will see the error on the deployed
  7. app, so be very careful about that. Do the multiple
  8. filters per query increase data store writes? Definitely they do,
  9. so for the conference for every time you write an
  10. index entry, you have multiple writes every time you save
  11. the conference. And again, the more index entries you have
  12. the more space they take up in the data store. So
  13. let's take a look at what the index configuration file
  14. might look like. We have a lot of different index
  15. entries in here. I'm not going to read through them all
  16. but you can see that, know we have one for conference,
  17. filter by city, sorting by name, conference, filtering
  18. by top pick, sorting by name, and so on
  19. and so on. So, for every possible combination that
  20. you going to allow the user to filter on, you
  21. need to add that combination to your index
  22. configuration file. And here we're looking at the indexes
  23. in the data store viewer and the admin console.
  24. I just uploaded my app with all the indexes.
  25. And you see they're busy preparing. But you see how
  26. many of them there are. You need to be aware of
  27. the need for indexes. Every query that your users are going
  28. to make has to have an index. And if it requires
  29. a composite index, you're going to need to make sure that
  30. the composite index exists on your application. And although this combination
  31. of filters uses many indexes, the results of the queries are
  32. fast because every search is pre-indexed so the query performance scales
  33. with the size of the result set, not the input
  34. data set. It's one of the great things about App Engine.