S
S
s_pyanov2018-11-09 10:05:24
NoSQL
s_pyanov, 2018-11-09 10:05:24

How to choose a method for storing online store data?

Good day to all.
I need to make an online store for shoes and accessories.
I want to use monga because: 1. it’s
fashionable (where would it be without it?!)
2. I want to try it exactly (to practice so to speak)
3. I’ll write the server part in Go, and it’s almost impossible to work with complex sql queries in Go ( problems with query result checks - joins are not supported by the current driver, etc.).
In this regard, I want to figure out in order not to step on a rake: how best to organize the structure of storing data about a product/categories?
A few words about how the catalog looks now.
Product data is stored in 1s(UT). They will be uploaded to a json file. Next, you need to parse this file and drive it into monga.
The structure of the nomenclature is as follows:
Brand 1
Collection1
...Products...
Collection2
...Products...
Brand 2
Collection1
...Products...
Collection2
...Products...
Product characteristics should, in theory, be the same (price, color, material), but not all. There are such things as different sizes from different suppliers (small sizes / under the domestic leg / European sizes, etc.).
There are ideas (I saw somewhere) that you need to organize a document with categories:
{main category, child category}
And assign a correspondence, main category and child category to each product. Is this how it should be done?
I will be glad for any information.
Thanks in advance!)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Cheremisin, 2018-11-09
@leahch

In my opinion, the storage architecture is not very correct.
Make two collections. One for Categories and one for Products.
Add the following fields to the Product: Brand, Category [array].
According to the characteristics of the product - they, alas, are not the same for me, so I store them in the Product as an array of objects

{ name: Сапог сложный
  sku: smart-shoozze-$Цвет$-$Размер$
....
Характеристики: [
{name: Цвет, value: Зеленый, type: checkboх, sku: GREEN},
{name: Цвет, value: Красный, type: checkboх, sku: RED}
]
....
}

To display filters - do aggregation on this field.
If perishing essentially - still there is a collection Remains. There is also a collection of Media Files.
If it's very deep, it's done on elastic, but there shouldn't be any problems with monga.

Y
yayashitoya, 2018-11-11
@yayashitoya

1. fashionable (where without it ?!)

Monga advantage only in clusters
https://www.youtube.com/watch?v=SNzOZKvFZ68
JOINs in Mongo are not normally supported at all.
This is not a relational DBMS.
Try an ORM reform rather than the standard Go driver.
In a documentary DBMS, which Monga is, entities are not divided into tables (normal form) as in relational ones.
Keep everything together.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question