What does “this delta memory” mean in the context of Terracotta?

I read the book Spring Recipes. I can not understand some things said about terracotta.

Below is a paragraph from a book

Terracotta differs from most clustered caches today because it does not have a visible API, and therefore its much more efficient way of passing changed state to nodes in the cluster. Most systems use some type of Java serialization or broadcast mechanism, where each other node is assigned the entire object or object diagrams that have been modified, regardless of whether they even need to know the new state. Terracotta does it differently: it shares the memory of the object graphs themselves and synchronizes other nodes in the cluster, because this requires a consistent view of the state of the object . In short, it can do something tantamount to passing only one updated variable to an object, not the whole object.

I can understand that it does not use anything like serialization to transfer objects through a cluster, but what does it mean “is it a delta of memory ”?

+4
source share
2 answers

As axtavt commented, Delta is essentially the difference between two instances of an object.

... he shares the memory of the object graphs ...

You can count in simpler expressions, for example ...

Defines the difference between instances of an object

What the paragraph says is ...

Other caching structures / technologies synchronize the state of objects across several nodes in a cluster, sending messages between nodes that contain each information about each instance, even data that has not changed. Terracotta processes this more efficiently only by sending information that has been modified to synchronize objects.

Think of it as an SVN commit. When you transfer the file to the SVN repository, your computer does not send the entire file to the server, it sends only diff (or delta) to synchronize the file storage version with your local copy.

Hope this helps!

+2
source

It is worth mentioning that the book is outdated and not the way that most people now use Terracotta (people use express mode, which is based on serialization for "user types").

In any case, trying to answer your question: “Terracotta tools”, your classes, so there are all the necessary hooks around the mutation and blocking the field, so the changes made (with the right lock) will be distributed, firstly, to L2 ( aka Terracotta server); secondly, nodes trying to read these fields.

I hope this (very quick and short) answer answers your question a bit.

+2
source

Source: https://habr.com/ru/post/1382257/


All Articles