Yes. Can be done. For user search I actually pull all profiles from npubs from huge relays like damus and primal in a local database. Could also get their follow lists and then from there you could query pretty fast for followers etc. will take some time for initial sync and you need to update every couple of minutes but then it should work more or less fast locally.
I understand. Maybe it would make sense to build a DVM for this that charges for said query, and potentially caches some of the stuff? Or a DVM for arbitrary queries of one's social graph? Do we have a query language for this?
CC nostr:nprofile1qqsfnw64j8y3zesqlpz3qlf3lx6eutmu0cy6rluq96z0r4pa54tu5eqpz9mhxue69uhkummnw3ezuamfdejj7q6hdgd nostr:nprofile1qqszv6q4uryjzr06xfxxew34wwc5hmjfmfpqn229d72gfegsdn2q3fgprdmhxue69uhhxct5v4kxc6t5v5hxs7njvscngwfwvdhk6qgkwaehxw309a5kucn00qhxummnw3ezuamfdejsz9nhwden5te0wfjkccte9cc8scmgv96zucm0d57awgv0
Discussion
nostrdb by nostr:nprofile1qqsr9cvzwc652r4m83d86ykplrnm9dg5gwdvzzn8ameanlvut35wy3gpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3qamnwvaz7tmwdaehgu3wwa5kuegpzemhxue69uhhyetvv9ujuurjd9kkzmpwdejhglzevy3 is probably the right tool for the "local cache" part
Could be. I use lmdb right now. Rust-nostr offers nice tools for here.