Greater Nebraska Software Symposium
April 4 - 6, 2008 - Omaha, NE
Alex Miller
Sr. Engineer with Terracotta Inc.
Alex Miller is a Sr. Engineer with Terracotta Inc, the makers of the open-source Java clustering product Terracotta. Prior to Terracotta, Alex worked at BEA Systems on the AquaLogic product line and was Chief Architect at MetaMatrix. His interests include Java, concurrency, distributed systems, query languages, and software design. Alex enjoys writing his blog at http://tech.puredanger.com and has spoken at a number of Java user group meetings and conferences.
In St. Louis, Alex is responsible for founding the Lambda Lounge, a user group for the study of functional and dynamic languages.
Presentations
Java Concurrency Idioms
This presentation will look at the many new additions in Java 5 and 6 for concurrent programming such as Atomics, Locks, synchronizers, and concurrent collections. In particular, we will be looking at common concurrency idioms around locking and access to shared state, thread coordination, thread pooling, and work execution. Each of these topics will be presented with code examples demonstrating common idioms and the usage of these new concurrency primitives.
Some topics we will cover in detail include: * Thread coordination with Thread.join(), CountdownLatch, and CyclicBarrier * Access to shared state with synchronized, volatile, Atomics, Lock, ReadWriteLock * Using Locks and Conditions to achieve more flexibility than synchronized and wait/notify * Concurrent collections like ConcurrentHashMap, CopyOnWriteArrayList, and ConcurrentSkipListMap * Work execution with Queues, ThreadPools, and Executors
Java Collections API
Did you know that Java 5 and 6 added 8 new interfaces and 16 new collection implementations to the JDK, more than doubling the size of the collection API? Collections 201 gives you an update on all of the interfaces, implementations, and utilities and gives you guidance on picking the perfect collection. In particular, Java 5 introduced a new major collection type Queue and a whole new java.util.concurrent package with data structures optimized for concurrent use.
This presentation will give an overview of the major collection types, with a particular focus on additions in Java 5 and 6 with interfaces like Queue, Deque, NavigableSet as well as new implementations like ConcurrentHashMap, ConcurrentSkipListSet/Map, and the family of Queue implementations like LinkedBlockingQueue.
In addition to covering the interfaces and implementations, we will also look at the backing data structures, iterator types, concurrency and performance concerns, and more.
Design Patterns Reconsidered
The Design Patterns book launched a revolution in object-oriented design and provided a vocabulary for OO developers to communicate their ideas. However, in some cases, patterns used blindly can lead to awkward, confusing, or hard to maintain code. It is time for some common patterns used in Java to be reconsidered so that we can derive the benefits from patterns while minimizing their concerns.
This talk will re-evaluate key patterns like Singleton, Template Method, Visitor, and Proxy. These patterns have downsides and in some cases, do more harm than good. Examples of each pattern will be give in Java and examined for clarity, testability, and flexibility. Important problems will be discussed and examples of alternate solutions will be given.
In the Singleton pattern, we'll look at problems like hidden coupling, testability, and extensibility and examine ways to use interfaces and dependency injection to avoid the need for the classic Singleton pattern. We'll also re-examine the double checked locking idiom and update it with current advice.
In the Template Method pattern will look at problems with communicating intent, composition, and API evolution and examine ways to refactor your code to use composition instead by way of interfaces, factories, and strategies.
In the Visitor pattern we'll look at how changes in data structures break existing visitors, problems with intermingling navigation and behavior, return values, exception handling, performance, and more. We'll look at alternative implementations that alleviate some of these problems.
In the Proxy pattern, we'll look at problems with maintaining proxies in the face of interface changes, loss of identity and type precision, and coupling. We'll examine some alternatives like static and dynamic code generation and composition.
Exploring Terracotta
Terracotta is an open-source Java clustering technology. It creates a virtual, durable Java heap that is shared across a cluster of Java Virtual Machines. This is done by dynamically instrumenting bytecode at load time to intercept calls to read and write fields, and also to enter and exit monitor locks. Information about these calls is then transmitted to the Terracotta Server (which can also be clustered) and out to other nodes in the cluster as needed. The advantage of this approach is that many Java programs can be clustered without code changes by providing just external Terracotta configuration. Many performance optimizations are performed to minimize communication and locking costs. Terracotta is commonly used for session sharing in web applications, distributed caching, and distributed workflow processing.
This presentation will give an overview of the Terracotta technology, how it's implemented, and common use cases that can benefit from the technology. We will look at some code and cluster some Java applications during the presentation.
Some topics that will be covered include: * Terracotta architecture * Heap replication without serialization * Distributed synchronized and wait/notify, cluster locking * Use cases * Example programs
Cluster your Cache with Hibernate and Terracotta
Terracotta (an open source technology) provides a clustered, durable, virtual heap. You can reduce the load on your database by allowing Terracotta to handle sharing and persistence of temporary conversational state in your web application. One option is to simply cluster your existing Hibernate L2 cache (for instance with ehcache).
A higher performance option is to disconnect your POJOs from the Hibernate session and manage them entirely in Terracotta shared heap until they are ready to be written back to the system of record. This option can yield extremely high performance while simultaneously reducing the load on your database, allowing you to scale your system with significantly less hardware.
This session will look at the Terracotta architecture and technology and how it can be used in tandem with Hibernate to create a scalable clustered cache that maximizes the benefits of POJOs.
Books
by Terracotta Inc.
-
Get the definitive guide on all the fundamentals of Terracotta as well as user secrets, recipes, and prepackaged frameworks.
Written by Terracotta's chief technology officer Ari Zilka and his team, The Definitive Guide to Terracotta: Cluster the JVM for Spring, Hibernate and POJO Scalability covers the following:
- High Availability (HA) nth degree scaling and clustering for traditional J2EE and Java EE 5 applications (using Seam or other application) as well as Spring–based enterprise applications
- Everyday Terracotta using its prepackaged frameworks and integration recipes, including configuration and customization for your application tuning, no matter the scale
- Power user secrets available, including config modules, customized advanced performance tuning, SDLC, Maven, and more
What you’ll learn
- See how Terracotta works fundamentally, and the user pieces and parts necessary for using Terracotta and its open source options
- Learn and apply case studies involving distributed cache, Hibernate, Master/Worker, and HTTP Session
- Understand thread coordination and advanced performance tuning
- Use more advanced case studies involving Spring, POJOs, FOO, and more
- Configure and create your own modules using the software development and deployment life cycle
Who this book is for
This definitive book from the Terracotta team is for both developers and architects who want to learn the “whats, wheres, whens, and whys” of the Terracotta scaling engine.
Table of Contents
- Theory and Foundation: Forming a Common Understanding
- History of Terracotta
- Jumping Into Terracotta
- POJO Clustering
- Caching
- Hibernate with Terracotta
- Extending HTTP Sessions with Terracotta
- Clustering Spring
- Integration Modules
- Thread Coordination
- Grid Computing Using Terracotta
- Visualizing Applications
-
Get the definitive guide on all the fundamentals of Terracotta as well as user secrets, recipes, and prepackaged frameworks.
Written by Terracotta's chief technology officer Ari Zilka and his team, The Definitive Guide to Terracotta: Cluster the JVM for Spring, Hibernate and POJO Scalability covers the following:
- High Availability (HA) nth degree scaling and clustering for traditional J2EE and Java EE 5 applications (using Seam or other application) as well as Spring–based enterprise applications
- Everyday Terracotta using its prepackaged frameworks and integration recipes, including configuration and customization for your application tuning, no matter the scale
- Power user secrets available, including config modules, customized advanced performance tuning, SDLC, Maven, and more
What you’ll learn
- See how Terracotta works fundamentally, and the user pieces and parts necessary for using Terracotta and its open source options
- Learn and apply case studies involving distributed cache, Hibernate, Master/Worker, and HTTP Session
- Understand thread coordination and advanced performance tuning
- Use more advanced case studies involving Spring, POJOs, FOO, and more
- Configure and create your own modules using the software development and deployment life cycle
Who this book is for
This definitive book from the Terracotta team is for both developers and architects who want to learn the “whats, wheres, whens, and whys” of the Terracotta scaling engine.
Table of Contents
- Theory and Foundation: Forming a Common Understanding
- History of Terracotta
- Jumping Into Terracotta
- POJO Clustering
- Caching
- Hibernate with Terracotta
- Extending HTTP Sessions with Terracotta
- Clustering Spring
- Integration Modules
- Thread Coordination
- Grid Computing Using Terracotta
- Visualizing Applications


