State Replication in ORMultiMap

70 views
Skip to first unread message

Mushtaq Ahmed

unread,
Jun 18, 2017, 1:00:53 PM6/18/17
to Akka User List
Suppose there is an ORMultiMap with 5 keys, each pointing to an ORSet of size 1000 items. Given that ORSet is a delta-CRDT, which one of the following happens on ORMultiMap.addBinding("a", 4) operation:

1. Entire map with 5000 entries will be replicated.
2. Only the delta of the ORSet (against key "a") is replicated.

Thanks.

Michal Borowiecki

unread,
Jun 18, 2017, 1:28:36 PM6/18/17
to akka...@googlegroups.com, Mushtaq Ahmed

ORMap and ORMultiMap don't mention delta support. On the contrary, docs for Maps say:

When a data entry is changed the full state of that entry is replicated to other nodes, i.e. when you update a map the whole map is replicated. Therefore, instead of using one ORMap with 1000 elements it is more efficient to split that up in 10 top level ORMap entries with 100 elements each. Top level entries are replicated individually, which has the trade-off that different entries may not be replicated at the same time and you may see inconsistencies between related entries. Separate top level entries cannot be updated atomically together.
The only way I can read it is that in your case the entire map with 5000 entries will be replicated.

Thanks,
Michał
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

--
Michal Borowiecki
Senior Software Engineer L4
T: +44 208 742 1600


+44 203 249 8448


 
E: michal.b...@openbet.com
W: www.openbet.com
OpenBet Ltd

Chiswick Park Building 9

566 Chiswick High Rd

London

W4 5XT

UK

This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postm...@openbet.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by OpenBet for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. OpenBet Ltd. Registered Office: Chiswick Park Building 9, 566 Chiswick High Road, London, W4 5XT, United Kingdom. A company registered in England and Wales. Registered no. 3134634. VAT no. GB927523612

Patrik Nordwall

unread,
Jun 19, 2017, 8:45:31 AM6/19/17
to akka...@googlegroups.com, Mushtaq Ahmed
ORMap and ORMultiMap have support for deltas. Nested deltas can be difficult so the current implementation is sending the full state of the changed entry of the ORMap, i.e. the 1000 items of the "a" ORSet in your example. There is variant of ORMultiMap that supports nested deltas but it has some other drawbacks as described in the (to be released) documentation: http://doc.akka.io/docs/akka/snapshot/scala/distributed-data.html#maps

Cheers,
Patrik

On Sun, Jun 18, 2017 at 7:27 PM, 'Michal Borowiecki' via Akka User List <akka...@googlegroups.com> wrote:

ORMap and ORMultiMap don't mention delta support. On the contrary, docs for Maps say:

When a data entry is changed the full state of that entry is replicated to other nodes, i.e. when you update a map the whole map is replicated. Therefore, instead of using one ORMap with 1000 elements it is more efficient to split that up in 10 top level ORMap entries with 100 elements each. Top level entries are replicated individually, which has the trade-off that different entries may not be replicated at the same time and you may see inconsistencies between related entries. Separate top level entries cannot be updated atomically together.
The only way I can read it is that in your case the entire map with 5000 entries will be replicated.

Thanks,
Michał


On 18/06/17 18:00, Mushtaq Ahmed wrote:
Suppose there is an ORMultiMap with 5 keys, each pointing to an ORSet of size 1000 items. Given that ORSet is a delta-CRDT, which one of the following happens on ORMultiMap.addBinding("a", 4) operation:

1. Entire map with 5000 entries will be replicated.
2. Only the delta of the ORSet (against key "a") is replicated.

Thanks.

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@googlegroups.com.

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@googlegroups.com.

To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Patrik Nordwall
Akka Tech Lead
Lightbend -  Reactive apps on the JVM
Twitter: @patriknw

Mushtaq Ahmed

unread,
Jun 20, 2017, 1:27:15 PM6/20/17
to Patrik Nordwall, akka...@googlegroups.com
Thanks Patrik! I will read though the snapshot docs.

Good to know the answer was none of the above :) 
Reply all
Reply to author
Forward
0 new messages