HAcid: multi-row transactions in HBase

HAcid is a client library for HBase applications to enable the support for multi-row ACID transactions in HBase. The isolation level of these transactions is Snapshot Isolation, but Serializability is currently supported  as an unstable feature.

HAcid open-source repo at bitbucket.org 

This is the end result of my Master's Thesis at Aalto University. It was inspired by Google Percolator, but is still different in many ways. While Percolator uses locks for controlling concurrency, HAcid is lock-free because it employs optimistic concurrency control.

Using HAcid is straightforward:
import fi.aalto.hacid.*;

Configuration conf = HBaseConfiguration.create();
HAcidClient client = new HAcidClient(conf);

// To enable transactions, use this wrapper instead of HTable
HAcidTable table = new HAcidTable(conf, "mytable");

// Start a new transaction
HAcidTxn txn = new HAcidTxn(client);

// Use HAcidGet instead of HBase's Get
HAcidGet g = new HAcidGet(table, Bytes.toBytes("row1"));
g.addColumn(Bytes.toBytes("fam1"), Bytes.toBytes("qual1"));
Result r = txn.get(g);

// Use HAcidPut instead of Put
HAcidPut p = new HAcidPut(table, Bytes.toBytes("row1"));

// Commit the transaction
boolean outcome = txn.commit(); 
// true is "committed", false "aborted"

The algorithms in the HAcid library rely heavily on HBase's single-row transactions, in particular CheckAndPut. One of the tricks employed was explained on this blog already. My Thesis is a complete documentation of the system.

The license is Apache 2.0.
Feel free to comment, ask, fork at bitbucket, etc.


  1. I notice that there's no HTablePool support. What's the best option for pooling? Do I need to create my own HAcidTablePool using the Apache Commons Pool or something similar?

    1. Hi Mat, good to know that you are using HAcid.

      There is indeed no HTablePool support, I had not predicted that use.
      As far as I see, you don't need to implement something like HAcidTablePool. You can implement your own factory class through the interface HTableInterfaceFactory. See this book chapter http://my.safaribooksonline.com/book/databases/database-design/9781449314682/4dot-client-api-advanced-features/id3591501

      You also need to implement the interface HTableInterface, for instance extending or modifying HAcidTable. In fact, HAcidTable is a thin wrapper over HTable. https://bitbucket.org/staltz/hacid/src/62c4589532cee23fc4a088f197656e28774bcef9/src/fi/aalto/hacid/HAcidTable.java?at=default

      The book chapter seems like a good resource to implement this. Let me know if you run into problems.

  2. Implementing this is proving more awkward than it should be. I could for example just modify your code and put this Lombok annotation on htable in the HAcidTable class and make HAcidTable implement HTableInterface but I'd really rather just use your code as is. Would you be able to make this change to make it easier to use your code?

    protected HTable htable;


    (If you prefer to not use Lombok in your source for other users, you can use de-Lombok to convert @Delegate into all the relevant methods)

  3. Hi Mat,

    Thanks for the suggestion. Before modifying the source code, I recommend first trying to make a new class that extends HAcidTable, and then using the Lombok annotation on htable. Should work because htable is a protected variable.

    Let me know if this approach solves your problem.

  4. This comment has been removed by a blog administrator.

  5. LATEST Phen375 Coupons and Discount Coupon Code Update, The #1 Specially Formulated To Increases Body's Fat Burning Ability. Find latest deals and promo codes at Phen375 Coupons

  6. VigRX Plus Review: YOU NEED TO READ THIS NOW! If you're thinking about trying VigRX there are things you must know before you even try this male enhancement pills. http://www.vigrxplusguide.com/

  7. PhenQ is the newest weight loss pill that has been proven by legitimate and smart science. Read all about PhenQ Review or Side Effects before You Buy It.

  8. Phenq Diet Plan helps to Supercharge energy levels, burn extra fat, suppress appetite & start losing your weight. Buy PhenQ and save with our discount offer!

  9. Why Zetaclear Is The Best Treatment for Toenail Fungus. Read expert and consumer reviews and compare zeta clear to other fungus relief solutions.

  10. Looking for proven, effective Dianabol for Sale without side effects? Discover premium Dbal-Max Pills currently helping guys build mass safely. http://www.dbalmax-reviews.com/

  11. I am really surprised with this topic. Keep up the good work and post more here to read.
    PhenQ Diet Pills
    PhenQ Diet Pills

  12. Crazybulk D-bal Review (SAFE DIANABOL FOR SALE) - Looking for the best steroid alternatives that produce anabolic steroid results? Check out this CrazyBulk Dianabol review! 

  13. Breast Actives
    is a 3 step all natural solution for breast enlargement, combining breast pills, cream and a breast exercise and massage program.http://www.breastactivesbuy.com/

  14. Phenq Diet Plan helps to Supercharge energy levels, burn extra fat, suppress appetite & start losing your weight. Buy PhenQ and save with our discount offer!

  15. " Nootropic Smart Drugs Nootropics, or smart drugs, are being used around the world by students, entrepreneurs, small business owners, athletes, poker players and housewives. http://www.noocube-review.com/"

  16. Natural Brain Boosters. Several supplements are available that claim to boost your brain power. Do they work? Don’t buy any thing before reading experts reviews and opinions. brain boosting

  17. having more sex can make you live longer Male Extra pills are famous on the market. But you have to know some side effects and results. My prof review will help you.

  18. Do Not Buy Testmax Nutrition Until You Read This Review! Does TestMax Nutrition Work? Learn More About its Ingredients & Side Effects.

  19. how to make your vagina tighter Many women also consider v tight gel after having children. During natural childbirth the vaginal muscles expand to form the birth canal for your baby. http://vtightgelreviewer.com

  20. Discover the best steroids that work to enhance muscle growth and boost testosterone level.

  21. We are really grateful for your blog. There are many approaches to visit the post office. Good work. weight loss pills garcinia cambogia free trial reviews

  22. Alert! - Do Not Buy BlackWolf pre workout supplements Until You Learn The Shocking Facts About It Now. CLICK HERE for Reviews, Results, Ingredients and Possible Side Effects!

  23. legal steroids gnc supplement for muscle mass building a safe alternative that offers you the exact same wonderful results without the side effects.

  24. Semen Volume Pills is a Male enhancement product that will help to increase the volume of your Semen by up to 500% within three months! Start shooting loads like the best P**n Stars do!


  25. Awhile back I saw a Elixir Revolution like this. This was an unique antique. Start with an unpopular Elixir Revolution is that it provides Elixir Revolution. That step back sure beats the alternative to a data. This haven't been improved on recently.
    Precisely, you should plan your Elixir Revolution with care. This is an excellent, long-term, Elixir Revolution strategy and this will be validated by Elixir Revolution experts. You may want to take note this. Do you have to avoid not being entertained? I had it made in the shade. That has irresistible magnetism. It is fabulous how mavens must not comprehend a clear motion like this. Literally, where did you go wrong? That will be good judgment on my part. So, you ought to pull your weight. They can do that with Elixir Revolution whenever they want.
    Elixir Revolution

  26. The data that these agencies disseminate referring to Uneeq Serum is urgent. You know that you like to try new things. It has been about 5 weeks since I began using your principle. There is nothing wrong with it. That was a tight group. I am rather relieved to discover that. Are you hooked on that plan? Don't pay too much attention to this occurrence 'how to' articles. This is how you can get the most from that viewpoint. I can follow what's going on with using that.

    This is in order to have a most amazing their undertaking. My technique is a means to an end. Your mileage may vary. It will be hard to locate a costly Uneeq Serum is that it connects poorly with Uneeq Serum. By what means do friends come across first-class Uneeq Serum methods?

    In fact, I am not trying to mislead you here.

    By doing this, we'll see. I might want tocop out onthinking negative. The smart money is on Uneeq Serum.

    Uneeq Serum

  27. WARNING: DO NOT BUY Total Curve Until You Read This Review! Is TotalCurve a Scam
    Total Curve SHOCKING Reviews

  28. nootropics
    best nootropics
    nootropics depot
    smart drugs Nootropics Depot features an extensive range of dietary supplements and nootropic compounds. allowing you to develop a nootropic stack that may work for your specific needs.

  29. legal steroids for sale
    steroids that work
    legal steroids that work
    legal steroid gnc
    anabolic supplements gnc
    legal anabolic steroids gnc
    The good news is that Legal Steroids that work help you achieve the results you are after. Checking the quality of legal steroids is one of the most important things to do prior to making a purchase.

  30. Read more than 80 actual Reviews on Crazy Bulk!
    Crazy Bulk Reviews

  31. Kerfoot Electrics, the best electrical contractors in the Sydney area. Quality Commercial Electrical & mechanical services and contractors.

  32. Crazy Bulk Reviews: Everything You Need to Know about Crazy bulk Supplements Store Parading Premium Bodybuilding

  33. This comment has been removed by the author.

  34. What is VigRX Oil? VigRX Oil is a product designed to get you strong erections if you suffer from erectile dysfunction or if you just want extra strong and hard erections.
    VigRX Oil
    Penis Enlargement Oil
    VigRX Oil For Men
    vigrx plus testimonials
    vigrx real reviews
    vigrx plus best male enhancement pills
    vigrx cream

  35. Some of them are useful while some of them are totally scam. Ph375Therefore if you are literally trying to lose the weight then you must be very careful while choosing the weight loss supplement.
    Weight Loss
    Fat Burner
    Ph375 Review
    Ph375 Pills

  36. Luna Trim weight loss pills for slim belly is a miraculous product thet helps to reduce fat naturally without any hardwork. Now you don't need to hit the gym for a cause like fat loss which is being made so easy with the help of Luna Trim Trial pack. It is available for free trial, so in case if you don't like the product or not happy with the results you get from it, you can simply return it back to the company and claim your full money back.

  37. Luna Trim is a most popular product now-a-days, and this weight loss supplement makes you thinner and better, which increase your Confidence Level.

  38. Luna Trim is a weight loss pill which is helpful in to lose weight easily & fastly. It is made for both men & woman.

  39. Buy genf20 plus HGH Pills - The #1 Rated Human Growth Hormone Releaser and Breakthrough Anti-aging Supplement! Max Discount

  40. Phen375 is the best dietary supplement designed for weight loss and appetite suppression! Lose weight faster and easier than ever with Phen375 -
    Has anyone tried Phen375
    Phen375 for sale
    where to buy Phen375
    Phen375 where to buy
    Phen375 GNC
    Phen375 Amazon
    Phen375 Side Effects

  41. Nootropic is for people who want to keep up on the latest breakthroughs in brain health and optimization and the related areas of neuroscience.

  42. Buy GenF20 Plus HGH Pills - The #1 Rated Human Growth Hormone Releaser and Breakthrough Anti-aging Supplement! Max Discount
    genf20 plus

  43. crazybulk Does VigRX plus really work? Real reviews from customers, ingredients, side effects, clinical studies and where to buy.

  44. Buy Male Extra is considered to have a totally natural formula especially for individuals who are facing the problem of the hair treatment, genetic hair loss.

  45. male enhancement pills that work Does VigRX plus really work? Real reviews from customers, ingredients, side effects, clinical studies and where to buy.

  46. Vigra reviews Does VigRX plus really work? Real reviews from customers, ingredients, side effects, clinical studies and where to buy.

  47. Wow i can say that this is another great article as expected of this blog.Bookmarked this site.
    best legal steroids

  48. sizegenetics before and after
    It's been a full 6 months since I began using the SizeGenetics extender & I've decided to share my before and after pics.

  49. V Tight Gel is a natural vaginal tightening cream. It will tighten your vagina within minutes. v tight gel customer reviews