3 ms·
> they also wholeheartedly embrace the thing everyone tries to avoid: mutable state on the server. For most apps in Phoenix LiveView, it's probably best to thi
by dnautics 6y ago
> they also wholeheartedly embrace the thing everyone tries to avoid: mutable state on the server.
For most apps in Phoenix LiveView, it's probably best to think of this as a "relatively smart caching layer". Keeping state on the client invokes distributed state concens anyways, and in the case of the Phoenix, at least the VM is well-equipped with the relevant primitives to make distributed state easy, especially. Basically the only cost you have to pay is if latency is a big deal, you are making a trip back and forth to the server, which could be 100s of milliseconds or more in bad situations... Or even really bad situations, like driving under a tunnel, or being in some stretches of subway.