667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 6 Messages: 6 Messages: 6 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Carbonado: Relational Persistence Abstraction

Posted by: Brian O'Neill on October 31, 2006 DIGG
Carbonado is a new relational persistence abstraction layer, capable of binding to different storage technologies. Whether you use JDBC or a BDB, an application written using Carbonado doesn't know the difference.

On the surface, it may appear that Carbonado is just another ORM, thus competing with Hibernate, JDO and EJB. One feature which makes Carbonado special is the ability to issue queries without translating to SQL. Using Carbonado against a BDB offers high performance by skipping all the translation layers offered by other solutions.

In order to query against a BDB, Carbonado adds support for indexes and joins. A rule-based query optimizer decides which indexes to use for a given query. For convenience, query objects have a method for printing the execution plan. Carbonado also supports traditional relational concepts such as constraints, triggers and transactions.

A common use of Carbonado is to replicate into a BDB, using it as a complete cache. All queries go against the cache, sparing your central RDMS from the load. In fact, if your RDMS is down, all queries from the replicated repository are still fulfilled.

Another feature of Carbonado is the ease in which persistent objects are defined and used. Carbonado Storables are not POJOs. They are defined as interfaces or abstract classes and more closely follow the Active Record design pattern. A few annotations are required to complete the definition, but the actual code to implement the Storable is automatically generated at runtime.

Carbonado was developed internally at Amazon.com, and now it has been released as an open source project. It was briefly mentioned on TSS a few weeks ago, but I chose not to announce until the site was ready and a release was available.

Although Carbonado is fast and stable, it is far from a finished project. Part of the motivation in releasing it as an open source project is to get community support. Likewise, it would be a shame to see such a useful project be confined and proprietary.

Threaded replies

·  Carbonado: Relational Persistence Abstraction by Brian O'Neill on Tue Oct 31 05:28:50 EST 2006
  ·  Curious by peter lin on Tue Oct 31 11:36:29 EST 2006
    ·  Rule based query optimizer by Brian O'Neill on Tue Oct 31 12:33:24 EST 2006
  ·  Re: Carbonado: Relational Persistence Abstraction by Erwin Bolwidt on Tue Oct 31 12:56:31 EST 2006
    ·  Benefits by Brian O'Neill on Tue Oct 31 13:15:37 EST 2006
      ·  Re: Benefits by Mark Hayes on Tue Oct 31 15:43:39 EST 2006
  ·  Sounds good by Raould Duke on Thu Jan 10 18:36:29 EST 2008
  Message #221282 Post reply Post reply Post reply Go to top Go to top Go to top

Curious

Posted by: peter lin on October 31, 2006 in response to Message #221201
I'm curious, what kind of "rule-based" query optimizer does it use?

peter lin

  Message #221293 Post reply Post reply Post reply Go to top Go to top Go to top

Rule based query optimizer

Posted by: Brian O'Neill on October 31, 2006 in response to Message #221282
I'm not sure what you mean by "kind". In general, query optimizers are defined as rule-based or cost-based. A cost-based optimizer creates a query plan based on estimating the time it will take. To do this, it gathers statistics on the data.

A rule-based optimizer, like the one used in Carbonado, creates a query plan based on heuristics. It is often easier to implement, but it can be dead wrong compared to a cost-based optimizer. As such, it often uses elements of the user's query for hints. For example, the order of the filter terms can make a difference.

With a good set of indexes, however, there's often not a big difference between the two approaches.

  Message #221298 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Carbonado: Relational Persistence Abstraction

Posted by: Erwin Bolwidt on October 31, 2006 in response to Message #221201
What type of application would benefit in your opinion from the approach taken by Carbonado versus existing solutions like Hibernate/JDO?

To be honest, reading the description, this sounds like a very technically cool project but with limited practical use.

What is the advantage of having to implement a specific interface for your objects instead of standard JavaBeans? And as much as BDB is nice and simple, why would you want to use it for business data? It doesn't integrate well with your corporate data infrastructure, does it? And how many administrators would know how to fix a broken BDB database?

Is the performance so much better than other solutions that it is worth it?

Erwin Bolwidt

  Message #221305 Post reply Post reply Post reply Go to top Go to top Go to top

Benefits

Posted by: Brian O'Neill on October 31, 2006 in response to Message #221298
Some of the benefits were outlined in this thread a few weeks ago, although for BDB DPL: http://www.theserverside.com/news/thread.tss?thread_id=42529
Performance is often much faster by skipping all the layers. I'm working on a PolePosition benchmark, and the results look pretty good.

Although Storables implement a specific interface, all the property access methods still follow JavaBean conventions. You can also have a common interface defining these properties, if you'd like to share between POJO based solutions.

As for BDBs, they are very useful for both large caches and canonical storage. They are also substantially easier to maintain than a traditional RDBMs. No need for a DBA.

Replication into a BDB, from a RDBMs is a good strategy as well. You offload work from a shared resource, and if something goes horribly wrong, you can resync the data into the BDB.

  Message #221317 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Benefits

Posted by: Mark Hayes on October 31, 2006 in response to Message #221305
Some of the benefits were outlined in this thread a few weeks ago, although for BDB DPL: http://www.theserverside.com/news/thread.tss?thread_id=42529


I'm an Oracle employee on the Berkeley DB Java Edition development team and I posted the article mentioned above.

We see most of our Berkeley DB users choosing Berkeley DB either for performance or simplicity (ease of development, deployment, maintenance) as Brian mentions.

But one thing that has always been missing is an API that allows the developer to easily switch between BDB and an SQL database, or to replicate data between the two. Carbonado fills that need and does a very good job of it. Prior to Carbonado, if a developer wanted the ability to very easily switch between BDB and an SQL DB he/she would have to implement a persistence abstraction of their own. Now Carbonado can be used as that abstraction.

Carbonado has other interesting features of course. I am biased toward the one I mentioned, of course, being part of the Berkeley DB team.

Another thing that is personally interesting to me about Carbonado is the usability of the API. It does not conform to a standard (JPA or JDO) as already mentioned, and this is what is interesting. Often APIs designed by small groups, outside of any standards body or committee, have more usable designs because they aren't as constrained. In my opinion the design of Carbonado has benefited from this factor and is easier to use than JPA or JDO.

Mark

  Message #245068 Post reply Post reply Post reply Go to top Go to top Go to top

Sounds good

Posted by: Raould Duke on January 10, 2008 in response to Message #221201
Much like C# lit a fire under Java, and Rails light a fire under... Java, I think this kind of new thinking is nothing but good, even if the project itself falters (which I sincerely hope it does not) - kicking db4o and Hibernate upside the head, and making us all stop and think about what else could be done is a huge community service. Kudos and thanks to the folks who put this out there for the world to see.

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map