# Database design problems

**URL:** <https://forum.adalo.com/t/database-design-problems/22970>\
**Category:** Database\
**Created:** [February 3, 2022, 8:48pm UTC](https://forum.adalo.com/t/database-design-problems/22970 "2022-02-03T20:48:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mag](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mag](https://forum.adalo.com/u/Mag)\
**Post date:** [February 3, 2022, 8:48pm UTC](https://forum.adalo.com/t/database-design-problems/22970/1 "2022-02-03T20:48:42Z")

</div>

Hi!  
im working on designing my database. And got some issues with the structuring of it.

Here is how the structure is built up to now.  
A main collection called “Database”

- it will consist of several thousands of rows, but one column.
- a name(text) for every row, like “apples”, “computers”, “icecream”, “wintertires”…and so on.

Then i create a collection for every row since all will be different collections.

- ex. apples, computers, icecream…

i put a search field on the homescreen to search the database for something. ex. apples.  
it looks like the examples below:

—————————————examples———————————  
Apples(collection)

- organic
- conventional  
Apples organic(collection)
  - Gaia
  - Granny smith  
Apples conventional(collection)
  - pink lady
  - Rosedene

Computers(collection)

- laptops
- desktops  
Computers laptops(collection)
  - brand, cpu, harddrive, memory, weight, price  
Computers desktops(collection)
  - brand, cpu, harddrive, memory, price  
Computers monitor(collection)
  - brand, size, weight, price

Icecream(collection)

- sorbet
- frozen youghurt
- gelato  
Icecream sorbet(collection)
  - flavor  
Icecream sorbet flavor(collection)
    - strawberry, vanilla, pear  
Icecream sorbet strawberry(collection)
      - brand, volume, price  
Icecream sorbet vanilla(collection)
      - brand, volume, price  
Icecream sorbet pear(collection)
      - brand, volume, price  
……and so on.  
————————————————————————

when i do a separate screen for the apples collection and for computers collection and for icecream collection as an example to make the database collection show the list composed to each collection. and then do a search the app just go to the first action link in the list to access.

Then since there are different row combination(text, pictures…) for different collections. i have to have separate lists for them.

In short i want to search from my database collection and from there link to all other collections connected  
to the database collection. how do i do that?

(there will be pictures for some products att different lists, some collections will only have text, others will have text and pictures, some collections will have links to videos.)

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [February 3, 2022, 11:13pm UTC](https://forum.adalo.com/t/database-design-problems/22970/2 "2022-02-03T23:13:28Z")

</div>

Hi @Mag ,

To have a search function you need to flatten the database collections, so you can pick which levels are deep enough for all possible types of data, let’s say level 6, then you put all the data in this level even they only exist at level 1 in our mind, but all levels to the deepest should be created too.

To have faster search, there is a method called satellite collection, which is a copy of your collection but in minimal set, it is better to include id, so you let user search in this minimal set and when they want to go to detail, link to the original collection with that id.

---

<div class="post-metadata">

**Author:** ![Mag](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mag](https://forum.adalo.com/u/Mag)\
**Post date:** [February 4, 2022, 9:35am UTC](https://forum.adalo.com/t/database-design-problems/22970/3 "2022-02-04T09:35:38Z")

</div>

Thank you very much Yongki!
