Replies: 2 comments
-
In fact, this is an old problem, that is, the synchronization problem of objects in a weakly consistent system The cyfs network based on device-zone is itself a "weak consistency network", that is, the consistency of updating and synchronization of objects inside the network is difficult to guarantee, so we have introduced the following object design rules. First, we clarify two concepts- Mutable objectsobject with body, object-id will not change after body modification - Immutable objectsobject without object, that is, the content stores in the desc content, if the content changes then object-id will change to a new object Two principles1. Be careful to add and use mutable objectsThe vast majority of objects should be immutable objects, so there is no consistency problem; to match this pattern, the introduction of root-state, you can request the corresponding data by 2. For mutable objects, use a strong consistency system to ensureAt present, it is guaranteed by the meta chain (block chain), for example, now the system inside the device and people object itself are mutable objects, and may change sometimes, so in order to ensure consistency, require the device and people object are stored in the meta chain, to ensure that the entire network the latest version of the object can be obtained with object-id. If you don't use meta chain or similar centralized system to ensure the consistency of mutable objects, and only rely on the maintenance between zones, it will be very cumbersome and bring heavy burden So back to your requirement, I think we can consider it from the following two perspectives.1. What information should be stored in the people objectIf it is frequently changing information, or a large amount of data information, it will lead to high costs for people in the meta chain (publish and rent costs, etc.), so it should be more appropriate to store some information that changes less For information that changes frequently and has a large amount of information, it is recommended to use 2. Current cyfs-stack internal synchronous management of mutable objects (with body object)At present, cyfs-stack actually lacks systematic synchronization of variable objects, so some synchronization mechanism should be designed to ensure the consistency of variable objects to some extent |
Beta Was this translation helpful? Give feedback.
-
As for how to improve the consistency of mutable objects inside cyfs-stack, consider the following improvements:
|
Beta Was this translation helpful? Give feedback.
-
My product needs to display the username and avatar of the people, but when the user updates the name and avatar, the people object obtained from CYFS is not updated. I believe many products have a similar need for this feature, and I hope CYFS can automatically update people information.
Beta Was this translation helpful? Give feedback.
All reactions