Thursday, January 3, 2013

Akka Essentials Giveaway contest!

Year 2013 has begun and what better way to start then by participating in the contest organized by Packt Publishing.

The Prize

The prizes are 2 print copies and 2 ebooks of my new book Akka Essentials that was published couple of months back.

Akka Essentials will show you the current challenges with Java Scalability and concurrency model and how Akka’s Actor Model can help you design and build applications that are inherently scalable and fault-tolerant. Whether you are building new applications or want to refactor an existing application, you will learn the right techniques to build and scale up in no time.

This book is aimed at developers, architects who are building large distributed concurrent and scalable applications using Java/Scala.

What you will learn from Akka Essentials:
Scale up and out your applications using dispatchers and remoting
Build fault tolerance within your application
Handle transactions within your application
Unit test your Akka applications
Integrate your Akka applications with existing enterprise systems using Zeromq
Monitor the health of your Akka application

How to Win Akka Essentials

You can enter by writing a comment to this post explaining why you would like to have the book. The contest has already started and will end on January 31st 2013 at 11:59 PM GMT. Winners will be randomly chosen and notified by email, after termination of the contest. Please do not forget to leave your email id in the comment.

The contest is open to everybody in the world, however print copies are only available to residents of the US
and Europe.

Comments are moderated by me, so your comment will not appear immediately.

I wish all the contest participants good luck.

Wednesday, January 2, 2013

Software Transactional Memory (STM)

The Actor Model is based on the premise of small independent processes working in isolation and where the state can be updated only via message passing. The actors hold the state within themselves, but the asynchronous message passing means there is no guarantee that a stable view of the state can be provided to the calling components. For transactional systems like banking where account deposit and withdrawal need to be atomic, this is a bad fit with an Actor Model.So, if your Akka applications need to be implementing a shared state model and providing a consensual, stable view of the state across the calling components, Software Transactional Memory (STM) provides the answer.

STM provides a concurrency-control mechanism for managing access to shared memory. STM makes use of two concepts –  optimism and transactions to manage the shared concurrency control.
  • Optimism means that we run multiple atomic blocks in parallel, assuming there will be no errors. When we are done, we check for any problems. If no problems are found, we update the state variables in the atomic block. If we find problems then we roll back and retry. Optimistic concurrency typically provides better scalability options than any other alternate approaches. 
  • Secondly, STM is modeled on similar lines of database transaction handling. In the case of STM, the Java heap is the transactional data set with begin/commit and rollback constructs. As the objects hold the state in  memory, the transaction only implements the following characteristics – atomicity, consistency, and isolation.