Getting Started with Redis, Spring Data & Cloud Foundry

Engineering | Costin Leau | April 27, 2011 | ...

One of the drivers behind the popularity of NoSQL solutions is performance (especially) under heavy loads. Due to their data model, key value stores lead the pack, providing lightweight yet flexible means of working with data. In this entry, I am going to quickly showcase what it takes to work with a key value store (Redis) using Spring (Spring Redis) through one of Spring Data samples (RetwisJ) and deploy the app into the cloud (through Cloud Foundry) to share it with the world. I am going even further by using Windows, as a deployment platform for a change.

Redis

A popular choice among key-value stores is Redis, an open source, crazy fast database written in ANSI C weighting around 200 KB (yes, kilo-bytes) for the server or 400 KB for the entire package (includes a command-line client and some administration utilities) and available virtually on all major platforms which also makes it the choice for the sample. Note that a Redis instance is not needed unless one wants to run the sample locally. If so, for Windows users (such as the author) yours truly uses (and recommends) this pre-packed version available in both 32-bit and 64-bit flavours.

Spring and NoSQL

If you are using NoSQL from a Java environment, take a look at Spring Data: it's not a project by itself but rather an umbrella of projects embracing the various new data access technologies such as non-relational databases (like Redis or MongoDB), map-reduce frameworks (think Hadoop) and cloud-base data services for Java apps. Spring Data promotes the classic Spring values, enhancing developer productivity by removing the API noise, boiler-plate code and resource management and offering a consistent programming model. It builds on top of existing Spring features and projects (such as inversion of control, life-cycle management, type conversion, portable data access exceptions, caching and so on) so one can add it right away, with minimal effort in her application. And of course, just like the rest of the Spring projects, it is open source and available under Apache license.

Spring Data Redis

In the case of Redis, Spring Data offers dedicated support through the Spring Data Redis or simply Spring Redis project. It offers both low-level and high-level features ranging from portable Redis client abstractions (allowing different Redis clients such as Jedis, JRedis or RJC to be changed with literally one configuration line) to Redis-backed atomic collections or counters or pub-sub support. The project reference documentation covers these topics in great detail.

RetwisJ, YATC - Yet Another Twitter Clone

RetwisJ source code, including the code in this blog, can be downloaded at Spring Data Key Value sample project. Further more, documentation is available at here

RetwisJ can be seen as the Java port of Redis' Retwis sample: a simple Twitter-clone that demonstrates how one can replace expensive joins in a traditional, relational database with Redis flexible data model (such as set intersections

Advanced Spring Data JPA - Specifications and Querydsl

Engineering | Oliver Drotbohm | April 26, 2011 | ...

In my last blog post I introduced the basic feature set of Spring Data JPA. In this post I'd like to dive into some more features and how they can help you simplify data access layer implementation even further. The Spring Data repository abstraction consists of an interface based programming model, some factory classes and a Spring namespace to easily configure the infrastructure. A typical repository interface looks something like this:

public interface CustomerRepository extends JpaRepository<Customer, Long> {

  Customer findByEmailAddress(String emailAddress);

  List<Customer…

Deeper into Grails & Cloud Foundry

Engineering | Peter Ledbrook | April 21, 2011 | ...

In my previous post, I showed you how easy it is to deploy a Grails application to Cloud Foundry using the corresponding plugin. Hopefully that whetted your appetite and you are ready to look at a more complex Grails application that demonstrates the power of the GORM plugins and stretches the Cloud Foundry services. If you don't have a Cloud Foundry account yet, please be patient. The response to the announcement has been phenomenal so it is going to take some time to work through the backlog of requests.

GrailsTwitter

Simple Twitter clones have become almost the standard for sample Grails applications, so it's no surprise that another version has been developed for Cloud Foundry. You can find the code on GitHub along with the other Cloud Foundry samples and you can also test out an instance of the application

Eventing Data with RabbitMQ and Riak

Engineering | Jon Brisbin | April 21, 2011 | ...

As new applications take advantage of the scalability benefits of message brokers like RabbitMQ and cloud-scale datastores like Riak, it's inevitable that the two should become fast friends (the kind who actually talk to each other in person rather than the kind whose only contact is through Facebook).

So many of the applications we find ourselves writing these days have these two functions in the same application. Very often we want to update data as the result of a message or send a message as the result of updated data. Two new utilities facilitating RabbitMQ and Riak integration allow you…

This week in Spring: April 19th, 2011

Engineering | Josh Long | April 20, 2011 | ...

Welcome back to This Week in Spring. The enthusiasm for last week's Cloud Foundry announcement was outstanding and appears to be getting stronger! People all over the world have flooded the SpringSource and CloudFoundry forums, downloads pages and source repositories. What unprecedented activity!

Many of the different, powerful technologies coming out of SpringSource recently have been leading up to the Cloud Foundry release so I invite you to review some of the exciting stuff that's come out in the last few months that have become even more interesting in terms of the cloud and Cloud Foundry: Spring Gemfire, Spring AMQP, Spring 3.1 profiles, Spring 3.1 caching abstraction, Spring Data, Spring Integration support for NoSQL, and Spring Hadoop, vFabric Hyperic, vFabric RabbitMQ, and vFabric GemFire. Of course, for all of these technologies - the first, and best, tooling and development experience continues to be SpringSource Tool Suite and Spring Roo.

Ok, onward to this week's review. So much exciting stuff, so little time!

  1. Christian Dupuis has just written up a detailed blog on using STS to deploy to Cloud Foundry.
  2.  <li><A href="http://www.springsource.org/node/3103">Spring Roo 1.1.3</a>, featuring 
     Cloud Foundry support, shell enhancements, and improved support for composite primary keys - among other things - has been released. 
    </li>
    
    	 <li> DZone has published a <a href="http://refcardz.dzone.com/refcardz/spring-roo-open-source-rapid?oid=hom38521">Spring Roo RefCard</a> by the Spring Roo team's <a href="http://www.twitter.com/schmidtstefan">Stefan Schmidt.</a> This RefCard's a fantastic way to get going quickly with Spring Roo. Spring Roo, it could be argued, is ideally suited to the RefCard…

Spring Data Graph 1.0 with Neo4j support released today

Engineering | Michael Hunger | April 19, 2011 | ...

This announcement post is a guest contribution by the developers of the Neo4j team that worked closely with SpringSource's Spring Data team to provide the Spring Data Graph integration library.

Spring Data Graph Logo

For a friendly introduction to Spring Data Graph we’re hosting a free webinar with VMware presented by Neo Technology’s CEO Emil Eifrem on April 20 at two convenient times for the Americas and Europe. [Update: The webinar video is now available on youtube in the SpringSourceDev channel.]

Now that Spring is in the air, the Neo4j and Spring Data teams are happy that almost a year’s worth of work has produced our 1.0 version of the Spring Data Graph library. The Spring Data project aims to bring the convenient programming model of the Spring Framework to NOSQL databases. Spring Data Graph supports graph databases

Using Cloud Foundry from STS

Engineering | Christian Dupuis | April 13, 2011 | ...

By now you probably heard about Cloud Foundry, the open PaaS from VMware that was announced yesterday; if not make sure to check out the recording of the webcast. Eventually you have already read earlier blog posts introducing the Spring support for Cloud Foundry, the add-on for Spring Roo and the Grails plug-in.

With this post I’d like to introduce the Eclipse-based support for Cloud Foundry that lets you manage your cloud deployments, including configuration of Services and service bindings, application scaling, access to file resources and much more.

Installing the Cloud Foundry for Eclipse and STS

There are three options to install the Cloud Foundry plugin into SpringSource Tool Suite (STS) and plain Eclipse. I will go through those options step-by-step in order to help you get started quickly.

Installing through the STS Extension Install

Probably the easiest way to get started with the Cloud Foundry plugin is by installing it into a pre-installed copy of STS. You should have at least version 2.5.1.RELEASE installed; 2.6.1.SR1 is better. STS for various supported operating systems can be found on the download page.

Within STS select “Help > Dashboard…

Launching Cloud Foundry, The Industry’s First Open PaaS

Engineering | Rod Johnson | April 12, 2011 | ...

Today, we have exciting news for developers: the launch of Cloud Foundry: an open source “Platform as a Service” (PaaS) from VMware allowing easy deployment of applications written using Spring, Rails and other modern frameworks. Cloud Foundry breaks new ground in PaaS through supporting a choice of programming models; a choice of services from VMware and third parties; a choice of clouds for deployment; and being delivered in open source.

Since the creation of Spring, we’ve remained faithful to a few core values: notably, Productivity and Portability. Today, these proven values extend beyond Spring and Java into VMware’s broader cloud computing strategy. Spring makes developers more productive by reducing time spent away from business logic; Cloud Foundry eliminates time spent installing and configuring infrastructure such as application servers and JVMs. Spring facilitates portability between deployment destinations; Cloud Foundry is both a key deployment destination itself and a layer that…

Cloud Foundry for Spring Developers

Engineering | Mark Fisher | April 12, 2011 | ...

By now, many of you have probably seen the Cloud Foundry webinar and Rod's blog from earlier today. I'd like to provide a quick follow-up that features a "hello-spring" sample application deployed in the cloud. Thanks to Cloud Foundry, there's practically no learning curve at all.

Before we get started, let's consider three goals that have driven Spring from day one:

  1. focus on simplicity and productivity to make developers lives easier
  2. support innovative technologies in a consistent way
  3. ensure portability of applications across deployment environments

Then, consider those same three goals in relation to Cloud Foundry:

  1. Simplicity and Productivity: Deploying a Spring application to the cloud is as simple as dragging and dropping within SpringSource Tool Suite, and even when building an application to run in the cloud, developers can take advantage of the productivity gains enabled by Roo and Grails exactly as they normally would.
  2. Consistent Innovation: Projects like Spring Social and Spring Data embrace innovative technologies such as Twitter and non-relational data stores that are increasingly popular for cloud-based applications, and they do so in ways that are consistent with the existing Spring platform. Cloud Foundry provides services to support such applications. RabbitMQ will be available as a cloud service soon, so the same applies to applications that rely on RabbitMQ for messaging via Spring AMQP and Spring Integration.
  3. Portability: The cloud is first and foremost a new deployment environment, and yet it's easy to create an application that can run in and out of the cloud without even swapping configuration files.

With those goals in mind, we've designed a sample application that provides an introduction to Cloud Foundry for Spring developers. This is the first of many…

Roo + Cloud Foundry = Productivity in the Cloud

Engineering | James Tyrrell | April 12, 2011 | ...

Today marks an important day for developers, with the public beta release of Cloud Foundry, VMware’s open source Platform as a Service offering. Rod Johnson’s blog contains a lot of background details about this exciting announcement, and Mark Fisher’s post offers a first look at the service and how easily applications can move between a local environment and the cloud. As both Rod and Mark highlight today’s announcement is about enhancing and ensuring developer productivity.

In support of this new service and platform we are pleased to announce that we have integrated Cloud Foundry support into Spring Roo - Spring’s rapid application development tool for Java developers. Now you can take Roo’s productivity to the cloud and you don’t even have to leave the shell! There are dozens of commands to make it easy to work with Cloud Foundry, and of course you can build a new application and deploy it to Cloud Foundry in just a few minutes. Once you’ve logged in, it’s as simple as using the new “cloud foundry deploy” command and…

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all