Best way to create a 'task' data structure

Before I go down this road, I’d like some input on the way to structure ‘tasks’ within my app.

The idea is that people would see the things they need to do on their home screen:

  • System generated tasks, such as ‘Complete your profile’ or ‘Reminder to…’
  • Tasks created by other users, such as ‘Complete this survey’

I’m looking to have the following data structure, which can obviously get quite big in the end state (1000s of users times 10s-100s tasks each):

Is there a more efficient way to structure this?

“E.g.” should have a comma after it: e.g., “e.g.,”.

Ha ha ha. But also, what’s your question again?

I don’t understand. Does a User have some Task that hasn’t been completed? Well, don’t remove the Task. Have they completed a Task? Remove the Task.

What’s the problem?

@keith In american-english, yes it’s “e.g.,” in british-english - it isn’t…

Ha ha ha. Anyway,

I guess I’m asking - if I have a tasks table that has 2 million records, what is the best way to show tasks in the screen I provided:

  1. Is it okay to ‘Do a search for’ Tasks where user = current user and status is not completed
  2. Would it be better to have a list of tasks on the user, and Get Current Users tasks, and then have a backend process that updates manages the list to only be current tasks.
  3. Is there a better way?

Thanks :slight_smile:

Tasks aren’t unique. Sure you could assign me a task “complete your profile”. How is that unique? It’s just the task “complete your profile”. How could there ever be two million of these? I suspect you’re being a dumb dumb.

Could two million users have uncompleted profiles? Sure. But that’s all the same Task.

Well I had imagined I would need to create a record for every occurrence of that task, so that I could see what each individual’s status is? How would you approach this? Happy to keep talking in riddles but it seems you have a good idea on what I should do here.

Thanks :slight_smile: