Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HStore Lightning Talk

HStore Lightning Talk

The lightning talk I did at the May 1st, 2012 Dallas Ruby Brigade about HStore.

Jesse Dearing

May 02, 2012
Tweet

More Decks by Jesse Dearing

Other Decks in Programming

Transcript

  1. Yo dawg... I put NoSQL in your SQL So you

    can SQL while you NoSQL Tuesday, May 1, 12
  2. I don’t need a full NoSQL solution Can’t I just

    put a hash in my RDBMS? Tuesday, May 1, 12
  3. I don’t need a full NoSQL solution Can’t I just

    put a hash in my RDBMS? Tuesday, May 1, 12
  4. NoSQL is hard...let’s go shopping • A full NoSQL DB

    is another tech to learn • A full NoSQL DB is another server to maintain • What do you need to do that would benefit from lack of a schema? Tuesday, May 1, 12
  5. How to use this in Ruby gem install ‘activerecord-postgres-hstore’ Store

    hashes in a column hstore type in AR migrations Performance! Tuesday, May 1, 12
  6. How to use this in Ruby gem install ‘activerecord-postgres-hstore’ Store

    hashes in a column hstore type in AR migrations Performance! Tuesday, May 1, 12
  7. Watch out! • Not a full NoSQL store, cannot do

    atomic operations (upsert, increment, etc.) • Must re-set the whole hash (using the gem) • model.hstore_col = { :foo => ‘bar’} • To access values in Ruby I had to call #symbolize_keys! • model.hstore_col.symbolize_keys! Tuesday, May 1, 12