Monday, 29 April 2013

Faster transaction protocols in Infinispan!


The total order based protocol is a lock free commit protocol that relies on the concept of totally ordered delivery of messages which, informally, implies that each node which delivers a set of messages, delivers them in the same order.
This protocol comes with this advantages.
  1. transactions can be committed in one phase, as they are delivered in the same order by the nodes that receive them.
  2. it mitigates distributed deadlocks.
The weaknesses of this approach are the fact that its implementation relies on a single thread per node which receives the transaction and its modification from other nodes in the cluster, and the slightly higher number of messages exchanged by JGroups.
Thus, this protocol delivers best performance in scenarios of high contention, in which it can benefit from the single-phase commit and the thread that delivers/applies transactions is not the bottleneck.
Currently, the Total Order based protocol is available only in transactional caches for replicated and distributed modes and it is available in Infinispan 5.3.0 Alpha1.
If you are interested in know more, please take a look at the user documentation where it is explained in more detail how it behaves and how you can configure it. Since this is a recent work, if you find any incorrect behavior please create a JIRA.
Please find below some benchmarks comparing the total order based implementation with the locking based implementation in two different scenarios:
  • Contention: 1000 keys in a shared pool, 8 threads per node and 5 writes (on average) per transaction;
  • No Contention: 1000 keys in a thread private pool, 8 threads per node and 5 writes (on average) per transaction.



Tuesday, 23 April 2013

Give Java Caching Standard API a go using Infinispan 5.3.0.Alpha1!

As part of the recent Infinispan 5.3.0.Alpha1, the first Infinispan JCache implementation was released which implements version 0.6 of the JCache specification as defined by JSR-107. It passes 100% the mandatory TCK including optional transactions TCK.

A document on how to use Infinispan JCache implementation has just been released, which explains the basics of using JCache, how it differs with existing APIs provided by the JDK, and how to cluster JCache based cache instances. More information will be added to the document, including quickstarts, as we make further progress in the Infinispan 5.3 series.

Please note that the CDI and annotations part of JCache 0.6 specification is still in flux, and we're not yet able to provide an implementation for it, but we expect the issues stopping the implementation to be resolved in the near future.

Finally, as it's expected from first releases, some bugs might be present, so if you encounter any misbehaviour, check the list of issues associated with the JCache component to see if the issue has already been resolved, or if not, please report it so that it can be fixed ASAP :).

Cheers,
Galder

Thursday, 18 April 2013

Infinispan coming to Brazil's JUDCon!!

Infinispan team is coming to São Paulo (Brazil) to present on multiple topics around caching, data grids and NoSQL in Brazil's first ever JBoss Users & Developers Conference (JUDCon). The event is being held over two days, on 19th and 20th of April.

On the 19th, Manik Surtani and Pete Muir will present on how to supercharge web applications using JBoss Data Grid. Expect a very lively presentation from these very seasoned presenters :)

Another presentation where you'll be able to see Infinispan in action is in Shekhar Gulati's "Closed PaaS to Open PaaS : Migrate GAE Applications to OpenShift Using CapeDwarf" and Randall Hauch's "Elastic Consistent NoSQL Data Storage with ModeShape 3" talk, both on the 19th of April, where Shekhar and Randal will demonstrate JBoss projects using Infinispan heavily.

On 20th of April, I'll be speaking about scaling up Hibernate/JPA applications with Infinispan second-level cache. Even if the Infinispan caching provider was created almost 4 years ago, this is the first time I'm presenting about it. Really looking forward to that.

Finally, I'll also give the first ever presentation on Infinispan JCache (JSR-107) API implementation, which will be mostly a live coding session showing different bits about JCache API and the extra capabilities JCache users get from using Infinispan implementation.

Cheers,
Galder

Wednesday, 10 April 2013

Infinispan Server 5.3.0.Alpha1

Hi all, as most of you know Infinispan has supported several protocols (HotRod, Memcached, REST, WebSocket) to expose caches to remote clients.

Traditionally these servers have been packaged in Infinispan's distribution with a simple shell script to demonstrate how they should be started (apart from the RESTful server which was packaged as a WAR file).

Since the release of Infinispan 5.3.0.Alpha1 we now have a proper distribution for these servers based around a stripped-down JBoss AS 7.2.0 server. What you get is robust support for all of the collateral services needed by the servers (JDBC Datasources, Transactions, Security, Logging, etc) and a solid platform for exposing your remote caches. Because the Infinispan Server only contains the essential services required by the server endpoints, it is not a full-fledged JEE application server, i.e. it cannot be used to deploy applications or host other services.

To get started with the Infinispan Server, grab yourself the distribution, unpack it and use the provided bin/standalone.sh or standalone.bat depending on your operating system.
The server should come up with HotRod, Memcached and REST endpoints. 

The easiest to try out is the REST endpoint using the provided web-based console available on http://localhost:8080. Please also note that by default the REST server is protected using BASIC HTTP authentication. You should use the provided add-user.sh or add-user.bat scripts, depending on your platform, to add valid users as follows:

bin/add-user.sh

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a): b

Enter the details of the new user to add.
Realm (ApplicationRealm) :
Username : user
Password :
Re-enter Password :
What roles do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: REST
About to add user 'user' for realm 'ApplicationRealm'
Is this correct yes/no? yes
Added user 'user' to file 'infinispan-server-5.3.0.Alpha1/standalone/configuration/application-users.properties'
Added user 'user' with roles REST to file 'infinispan-server-5.3.0.Alpha1/standalone/configuration/application-roles.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? no


Now open the console by clicking on the [+] in the bottom left corner of your browser window and the following form should appear:

Type the following commands:

PUT /rest/default/a a

Authenticate using the user/password combination you created above and the server should respond with a [200] Success message. In the above command, rest is the name of the endpoint (you can have multiple endpoints pointing to different cache managers or with different security levels), default is the name of the cache and a is the key. The second a is the value you want to associate with the key.
Now retrieve the value using the following command:

GET /rest/default/a

which should respond with a [200] a message. The console supports the various PUT, GET, DELETE, POST, HEAD methods as well as some basic HELP and is capable of recalling history using the up and down arrows.

During the course of the Infinispan 5.3.0 cycle we will be adding documentation and features, so stay tuned and if you have any feedback use the forum or our issue tracker.

Tuesday, 9 April 2013

Infinispan 5.3.0.Alpha1 is out!

With a code name hard to match - Tactical Nuclear Penguin - and besides almost 50 bug fixes, this release contains several important features:
  • Total Order (TO) transaction protocol developed within the scope of the CloudTM project. The TO exhibits very good throughput in scenarios in which multiple transactions modify the same key set concurrently (high contention)
  • support for JSR-107 (Java Caching API) implementation, allowing Infinispan to be used as a cache provider 
  • A new implementation of the Lucene Directory for Infinispan based on Lucene 4. Compatible now with all versions of Apache Lucene from 2.4 to 4.2.
  • A new packaging for the Infinispan server modules, based on the JBoss AS
Please stay tuned for blogs detailing all these features. For a complete list of features included in this release refer to the release notes.
Visit our downloads section to find the latest release and if you have any questions please check our forums, our mailing lists or ping us directly on IRC.

Cheers,
Mircea