Q
Q
Qubert2014-07-05 21:01:56
PostgreSQL
Qubert, 2014-07-05 21:01:56

What is the correct way to store data for this case?

Good evening everyone!
I need to store presentation data: color, font, leading ( =) ), dimensions, pictures, graphics, texts that the user has selected.
I have several questions for this whole question (which is in the title):
1) In what form can coordinates of located objects?
there are several suggestions for storing such data specifically from me:
1) JSON in PostregSQL (completely global data will be stored in a separate table (for example, the number of slides, etc.)
2) just in MySQL tables with columns for all styles
Please tell me your visions or solutions to this problem ...because perhaps it will be my next step in my professional development...
I would be wildly grateful!
Have a nice weekend =)))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladlen Grachev, 2014-07-05
@Qubert

I still don’t understand why JSON is in PostgreSQL, and if without JSON, then MySQL, well, that’s not the point.
In principle, JSON or just tables - here it will be more convenient. The input and output are the same. In my opinion, it is better to store properly structured data in a database. And with JSON to work if necessary already, I don’t think that it will be a problem to convert back and forth.
But it is probably worth getting rid of the columns for each style. Some styles are optional, some are only for individual objects - why redundancy? You can have a table of objects, a table of properties. And styles should be stored in a binding table with columns: object id, property id, property value.
It should be convenient to take CSS as a basis for properties. Many familiar rules, quite a logical system. There are already all methods for storing text parameters, including leading and kerning. You will have to invent your own quite a bit.
As for the coordinates. You can make a snap to the left and top edges, set X and Y, respectively. In addition to X and Y, you can also set, roughly speaking, the starting point. Let's say the default is the top left corner, but if we set the origin property to right-bottom, then the object will be positioned so that the bottom right corner will be shifted X and Y from the bottom right corner of the object being positioned relative to .
Positioning principles can also be taken from CSS, the same absolute and relative.
To summarize, you need to make your HTML + CSS with blackjack and storing styles in the database. Take a break from this (=

Z
zxmd, 2014-07-05
@zxmd

What is not mongodb ? It seems that your concept fits well with mongo objects.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question