79149464

Date: 2024-11-01 21:32:00
Score: 0.5
Natty:
Report link

Excellent question, to begin let's start at a common ground with CRUD:

In CRUD, we lay our application's methods out like such:

The second method 'Read' is essentially what you want to do against the User table in your database or object store.

In your read function rather than searching for

where user.twitterId == 'mySearch'

Instead do

where user.twitterId LIKE '%mySearch%'

The first would restrict your users to knowing IDs exactly, whereas the second gives leeway yet may be slow; thus begins your optimisation journey via tweaking

  1. The query (query optimisation)
  2. Where you store the results (caching/sharding)
  3. When do you run the query (runtime optimisation)

To answer your question, yes twitter may be querying a list of you and/or your friends followers on app startup or slowly as you use it, which is their solution in runtime optimisation.

Perhaps in your app each post retrieved will come with their top 5 contributiors which are added to relevant Ids to search.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Mitchell Spangler