Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> No pesky laws of physics.

While developing on a single host (especially in traditional imperative and object-oriented languages) papers over a lot of fundamental physics. The nonexistence of absolute simultaneity and the derivative concept of data gravity are very much a thing in even the most basic contemporary software systems... The most ubiquitous system to deal with it, is I would say, the "Virtual DOM".



What's data gravity?


"Data gravity is a metaphor introduced into the IT lexicon by a software engineer named Dave McCrory in a 2010 blog post. The idea is that data and applications are attracted to each other, similar to the attraction between objects that is explained by the Law of Gravity. In the current Enterprise Data Analytics context, as datasets grow larger and larger, they become harder and harder to move. So, the data stays put. It’s the gravity — and other things that are attracted to the data, like applications and processing power — that moves to where the data resides."

https://www.cio.com/article/3331604/data-gravity-and-what-it...


it's the concept that data are difficult to move and attract the code to it. Generally used, in the large to describe things like AWS S3 attracting AWS to build services on top of it. But I think it's true in the small, too like "frameworks on top of each person's browser data".


What's a virtual dom? Some sort of socially-distanced BDSM scene? What does it have to do with imperative programming and object-oriented languages?


Probably taken from: https://reactjs.org/docs/faq-internals.html#:~:text=The%20vi....

Tl;dr It's a representation of the Document Object Model in JavaScript/application land. Changes are made to it before updating the actual DOM, because real updates will cause reflows, repaints and other expensive operations that can slow down the page.

No idea what that has to do with anything else GP said though.


Can you explain how a virtual DOM solves what you're talking about? Seems to be a non sequitur to me.


There's all sorts of separate sources of truth in that system: Data that exists in the server, data that exists in your javascript frontend, data that exists as pixel intensities in the screet. At a high level, the virtual DOM exists to arbitrate the non-simultaneity of updates to all of these moving parts. It lets react model its system as a "single source of truth" with a functional "prop-drilling system". It gives react components gravity to a data source it can consider authoritative (separate from the actual DOM which attracts the browser's own sets of sub-applications) which is also separate from the applications sitting on top of your data in the server, etc. etc. etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: