Liveblogging at Confoo: Blending NoSQL and SQLPersistence Smoothie: Blending NoSQL and SQL – see user feedback and comments at http://joind.in/talk/view/1332.
NoSQL tries to scale (more) simply, it is starting to go mainstream – NY Times, BBC, SourceForge, Digg, Sony, ShopWiki, Meebo, and more. But it’s not *entirely* mainstream, it’s still hard to sell due to compliance and other reasons. NoSQL has gotten very popular, lots of blog posts about them, but they reach this hype peak and obviously it can’t do everything. “NoSQL is a (growing) collection of tools, not a new way of life.” What is NoSQL? Can be several things:
Key-Value Stores memcached is a “big hash in the sky” – it is a key value store. Similarly, NoSQL key-value stores “add to that big hash in the sky” and store to disk. Speaker’s favorite is Redis because it’s similar to memcached.
Another interesting key-value store is Riak
Map Reduce:
Other key-value stores: Document Databases Some say that it’s the “closest” thing to real SQL.
Column-oriented store Columns are stored together (ie, names) instead of rows. Lets you be schema-less because you don’t care about a row’s consistency, you can just add a column to a table very easily.
Graph Databases speaker’s opinion – there aren’t enough of these. Neo4J – can handle modeling complex relationships – “friends of friends of cousins” but it requires a license. When should I use this stuff? If you have:Use Complex, slow joins for an “activity stream”Denormalize, use a key-value store. Variable schema, vertical interactionDocument database or column store Modeling multi-step relationships (linkedin, friends of friends, etc)Graph Don’t look for a single tool that does every job. Use more than one if it’s appropriate, weigh the tradeoffs (ie, don’t have 7 different data stores either!) NoSQL solves real scalability and data design issues. But financial transactions HAVE to be atomic, so don’t use NoSQL for those. A good presentation is http://www.slideshare.net/bscofield/the-state-of-nosql. Using SQL and NoSQL together Why? Well, your data is already in an SQL database (most likely). You can blend by hand, but the easy way is DataMapper: Generic, relational ORM (adapters for many SQL dbs and many NoSQL stores) Implements Identity Map Module-based inclusion (instead of extending from a class, you just include into a class). You can set up multiple data targets (default is MySQL, example sets up MongoDB too). DataMapper is:
Speaker’s idea to be less generic and better use of features of each data store – Gloo – “Gloo glues together different ORMs by providing relationship proxies.” this software is ALPHA ALPHA ALPHA. The goal is to be able to define relationships on the terms of any ORM from any class, ORM or not Right now – partially working activeRecord relationships Is he doing it wrong? Is it a crazy/stupid idea? Maybe. Example: NeedUse Assume you already have an auth systemit’s already in SQL, so leave it there. Need users to be able to purchase items from the storefront – Can’t lose transactions, need full ACID complianceuse MySQL. Social Graph – want to have activity streams and 1-way and 2-way relationships. Need speed, but not consistencyuse Redis Product Listings — selling moves and books, both have different properties, products are pretty much non-relationaluse MongoDB He wrote the example in about 3 hours, so integration of multiple data stores can be done quickly and work.
|
Follow me on:SearchNavigation |