3 ms·
> UIs are built in trees? Take the Web's DOM as a prime example, but I think all major graphical user interfaces are primarily organized as a tree of nested co
by laurencerowe 7y ago
> UIs are built in trees?
Take the Web's DOM as a prime example, but I think all major graphical user interfaces are primarily organized as a tree of nested components.
> How so more than the RESTful JSON responses traditionally used?
For generating a flat JSON object with scalar values there's a natural mapping from the single row tabular result set to a JSON object. Add an array property from a one-to-many join and you start to notice the impedance mismatch. Do you live with duplicating the scalar properties in every row of the result set or make multiple queries? The more deeply nested the JSON result the worse the problem becomes.
> We shouldn't use SQL at all?
SQL is fine for producing tabular results but its ubiquity means we often end up using it in situations where it's an awkward fit. Relational database are very robust and suitable for many data models so it's often a reasonable tradeoff to make.
Hopefully in the future we might see a graph query language in relational databases: https://www.gqlstandards.org/ https://www.gqlstandards.org/