Hi AJ!
There are two ways to store this data. Either you store the JSON object
directly (which would just be a string). There's no benefit to doing
this though. What you should do is create a Person class which has the
properties you need to store, and implement NSCoding on it. I'm sure
you've read up on this already. So to answer the first question, yes,
YapDatabase is strict about key/value. But the value can be any kind of
object, including a JSON string (but you should use
NSObject-representations instead).
Your assumption that you don't need to create separate collections is
correct. Every Person can go in the People collection. However, you
should be open to using collections in more flexible ways that you
traditionally use database tables. It takes some getting used to working
with key-value stores instead of relational databases. There could be
different collections for different groups of People, for example.
Anyway, back to your questions. The search you're looking to do really
seems more fit for a relational database. Are you sure that a key-value
store is a good choice for your use case? It's possible to do this in
YapDatabase using secondary indexes or perhaps full text search
(
https://github.com/yapstudios/YapDatabase/wiki/Full-Text-Search).
However, in the end, a separate database table containing the properties
you want to be searchable will be created. If this works for your case,
then that's fine. The answer to your question is: no, all 100000 objects
will not need deserializing as long as you use some approach of
secondary index. If you want to be able to dynamically do any search for
any properties, then yes, it's likely that all objects will need
deserializing.
You don't necessarily need to use a view for this either. A view is one
kind of secondary index that's fit for some use cases. In particular,
it's great if you need a persistent/auto updating "fetch request" (as it
would be called in Core Data) that you want to show in your UI. For your
use case, I would assume that a plain secondary index or a full text
search is a better choice.
I hope this helps!