Firestore’s advantages:

  1. NoSQL Document Database: Data is stored as documents organized into collections rather than traditional rows and tables.
  2. Real-Time Sync: Changes made to data are automatically updated across all connected clients.
  3. Offline Support: Apps can read and write data even when offline, and changes sync when back online.
  4. Scalability: Designed to handle small to large-scale applications.
  5. Security Rules: Uses Firebase Security Rules to define permissions for reading/writing data.

Our use case

In our case, we will mainly need to store:

Personal user tasks

For the personal user’s task we will follow this structure:

/tasks (Collection)      ← A collection of all tasks
   ├── taskId123 (Document)  ← A specific task
   │       ├── title: "Task title"
   │       ├── description: "Task description"
   │       ├── is_completed: false
   │       ├── creation_date: 2025-03-31T11:43:12Z
   │       ├── due_date: 2025-03-31T11:43:07Z
   │       ├── user_id: "ELbBpGQh8KeLwTHEHapLllB9hjm1"
   ├── taskId345 (Document)  ← Another task
   ...

Groups

/groups (Collection)      ← A collection of all groups
   ├── groupId123 (Document)  ← A specific task
   │       ├── title: "Group title"
   │       ├── description: "Group description"
   │       ├── invite_code: "12345"
   │       ├── creation_date: 2025-03-31T11:43:12Z
   │       ├── participants: ["user1id", "user2id"]
   │       ├── user_id: "ELbBpGQh8KeLwTHEHapLllB9hjm1"
   ├── groupId345 (Document)  ← Another group
   ...