views:

44

answers:

1

I have this remote database of artists. About 6,000 entries for now. I want my app to:

  1. download a JSON-formatted index of the artist names (~95kb)
  2. import that data to CoreData
  3. provide suggestions/auto-complete when the user adds a new artist

I've done this before, but not on such a big scale. Will it become problematic when the database reaches 20 or 30 thousand entries? I'm not worried about the JSON filesize but mostly about CoreData's ability to quickly fetch data using an NSPredicate such as artist_name LIKE textField.text every time the textField changes value.

+2  A: 

At the very least, make sure you mark artist_name as indexed... that should help.

I'd also investigate other predicates and see if there's not a substring specific one that might perform better than LIKE.

You'll also want to look into pre-loading a database that holds that much data, and update it in the background... a 300k JSON file will take a LONG time to download if the network is at all poor.

Kendall Helmstetter Gelner
Yea BEGINSWITH actually makes more sense. Even though the autocomplete feature is a nicety, it's indeed a good idea to preload the app with some stock database. Thanks for the tips!
Sam V