On Monday, February 10, 2014 8:28:49 AM UTC+1, Patrik Nordwall wrote: > > Hi Vince, > > On Sun, Feb 9, 2014 at 3:38 PM, Vince Golding > <[email protected]<javascript:> > > wrote: > >> I am in the process of investigating how I would go about implementing a >> scalable fault tolerant order management system using an akka sharded >> cluster. >> >> Initially all orders will be limit orders whereby they are entered with a >> limit price and then executed once this limit price has been reached. >> >> My current thinking is to have individual orders represented as an FSM >> actor which receives a stream of price events, updating the state of the >> order once the price condition is met. >> >> I was intending to use a sharded cluster to distribute the orders across >> multiple nodes. The order actors will be made persistent using akka >> persistence so their state can be recovered after re-balancing etc. >> > > Sounds good, but is it the orders that are the sharded actors? Wouldn't > you shard the order books, and the orders are placed in the order books? > Could you clarify the domain, and the identifiers of the domain objects? >
I was initially thinking of making the orders sharded actors however I'm still fairly early in the design phase and I will most likely need to cater for different sharding strategies depending on the properties of the order population. Rolland made a good point about sharding on the tradable item to reduce price updates, and as you suggest, sharding on order book ( probably you mean order book for a given tradable item however could also be order book per client ) could be another option. > > >> >> So that the order actors can receive price events after re-balancing, I >> was going to create some sort of shard aware price publisher that the order >> actor could subscribe to on start up. The publisher would then publish >> price events via the sharded cluster. This would ensure the order actors >> would still receive price events after a rebalance. >> > > With each of these sharding strategies, I would still need a way to ensure price updates are propagated to the orders in the sharded cluster. The purpose of the price publisher would be to send price updates into the cluster with the relevant shard info whether that be order id, order book or tradable item etc. > I'm not sure I understand the purpose of the publisher until I understand > the domain better. > > /Patrik > > >> >> Is this a reasonable way to handle event streams for actors which belong >> to a sharded cluster? >> > >> To enable querying the state of all orders in the cluster, I was going to >> have each order actor register it's id in some central repository. This >> repository could then be queried for orders which are in the cluster and >> queries could then be sent to each order actor via the sharded cluster to >> retrieve it's state. >> >> Is this a sensible way to handle the querying of actor state in a sharded >> cluster? >> >> >> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >> >>>>>>>>>> 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 [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > > Patrik Nordwall > Typesafe <http://typesafe.com/> - Reactive apps on the JVM > Twitter: @patriknw > > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/groups/opt_out.
