Thursday, December 25, 2014

Patterns and anti-patterns in building Akka systems

"Let it crash" Principle
  • Recovery should be automatic to restore normal service as soon as possible
Inverted control flow
  • Better to push jobs than to pull them
  • Reduce the frequency of blocking requests
  • Fit nicely with short jobs that comes at a fixed rate
  • Not an adequate pattern when
    • jobs are produced faster than finished
    • jobs are expensive and should be avoided if possible
  • Solution: push jobs after old jobs are finished
    • Eg. push with rate limit / acknowledgement
Durable mailbox
  • Actor system doesn't guarantee the delivery of messages per se
  • Have to use additional protocols to approach this purpose
    • ack everywhere
    • store to persist
  • Asking for guarantees in an uncertain world takes costs
    • increased effort / complexity / latency
    • additional dependency in the architecture
Event sourcing
  • A good way to compile a list of time-series events
  • Has to take care of replication inconsistency, application latency, etc
Non-blocking request
  • Future-based messaging
Sentinel
  • handling failure above a supervisor, flow control and distributed workers

Sunday, December 7, 2014

Cloud Design Patterns

http://msdn.microsoft.com/en-us/library/dn568099.aspx

"This book contains twenty-four design patterns and ten related guidance topics, this guide articulates the benefit of applying patterns by showing how each piece can fit into the big picture of cloud application architectures. It also discusses the benefits and considerations for each pattern. Most of the patterns have code samples or snippets that show how to implement the patterns using the features of Microsoft Azure. However the majority of topics described in this guide are equally relevant to all kinds of distributed systems, whether hosted on Azure or on other cloud platforms."