Well while developing a web application that allow users to draw graphs (flow ch
ID: 651615 • Letter: W
Question
Well while developing a web application that allow users to draw graphs (flow charts, ER diagram , UML, .... etc) the information of drawn items and their relation to each other and position on canvas is expressed as JSON object
The question is:
1- is saving such graph in database as raw (json object text) is enough (in one field of a table) 2- or is it always required to break down the json object into logical pieces and store them into a well built database structure!
option 1- other than making devilopers life easier it will eleminate the need of recreating json object from small bits and pieces of information when the user open a graph he have built and saved long time ago
option 2- will have fine grain details in proper structure but will cost kind of heavy processing while opening a saved graph from Database
which way is correct way to go ?
Explanation / Answer
Splitting a user's drawing up into nodes and edges (and all their associated attributes) and storing them in tables would give you the advantage of being able to query a drawing.
The question is: do you really need that functionality? Or could you get away with just storing some metadata with the text representation of the graph?
Consider that there will be a lot more work involved in getting a drawing out of the database if it has many nodes, compared to extracting one large text field.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.