3 ms·
What I struggle to understand is why you would need need to 'sync' the DOM with your data? If you're dealing with atomic values, you don't need to diff or 'sync
by jondubois 11y ago
What I struggle to understand is why you would need need to 'sync' the DOM with your data?
If you're dealing with atomic values, you don't need to diff or 'sync' data. In Polymer, when you update data on the frontend,
it sends a CRUD update request to the server, the relevant field is then updated in the database, then a realtime notification is sent out to all frontends which
are subscribed to changes on that specific field.
Multiple fields might belong to the same 'object' but each field is atomic and can be updated independently of the whole object (without having to diff the entire object each time).
This is much more efficient on both the client and server because diffing is expensive and incurs a high latency and bandwidth overhead when you scale out.
Diffing is useful for collaborative editing of unstructured text documents, but it is not needed for structured (or even semi-structured) data.