Multiple Databases with Merb

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

  • + mattetti Matt Aimonetti 2 years ago
    Great talk Wesley!
  • + maraby Matt Todd 2 years ago
    Hey man, great presentation. Really brought to light the flexibility that DataMapper is intended to provide (and kinda reveals that it still has work to do).

    Great presentation!
Post a comment
Embed Video
Edit your comment Cancel

1 Favorite

Multiple Databases with Merb - Presentation Transcript

  1. Using Multiple Databases in Merb With special guest CouchDB Wesley Beary | Software Engineer wesley@plinky.com
  2. DataMapper! • database.yml maps first connection to the :default repository. • database.yml is a hash, each environment can have many keys. • Assign the primary database to the :default key and other databases to distinct meaningful keys (or not). Wesley Beary | Software Engineer | wesley@plinky.com
  3. # TODO: use them? • run a specific command: repository(:key) { some_command(s) } or Foo.all(:repository => repository(:key)) • set a model’s storage location: class Bar def self.default_repository_name :key end end Wesley Beary | Software Engineer | wesley@plinky.com
  4. Dear Sir or Madam, Why should I care? Thanks, The Audience Wesley Beary | Software Engineer | wesley@plinky.com
  5. one_size.should_not fit(:all) Wesley Beary | Software Engineer | wesley@plinky.com
  6. Example, Pretty Please? • MySQL • CouchDB • +/- schema based • +/- schema-less • + complex joins/queries • + map/reduce • + established security • - security TBA • - not good at blobs • + good at blobs Wesley Beary | Software Engineer | wesley@plinky.com
  7. CouchDB? • RESTful • javascript queries • json data • file attachments Wesley Beary | Software Engineer | wesley@plinky.com
  8. How about a use case? Muddle: merb + couchdb == tumblelog Wesley Beary | Software Engineer | wesley@plinky.com
  9. STI: Icky Tables • Single table inheritance gets gross. • Usually the fields for the parent and every child go on EVERY record. • CouchDB lets you store just what you need on a case by case basis. Wesley Beary | Software Engineer | wesley@plinky.com
  10. Tumbling • Each posts may have vastly different content/fields from other posts. • There are many different child classes derived from Post. • Some posts have associated files, attachments help keep it organized. Wesley Beary | Software Engineer | wesley@plinky.com
  11. Random Posts Wesley Beary | Software Engineer | wesley@plinky.com
  12. Direct From CouchDB! Wesley Beary | Software Engineer | wesley@plinky.com
  13. Wesley Beary | Software Engineer | wesley@plinky.com
  14. Details? • User data is safely stored in mysql. • Files save and load from CouchDB. • Mostly a proof of concept, needs work to flesh out the details still. • No load/performance testing just yet, hard to say how production-worthy parts might be. Wesley Beary | Software Engineer | wesley@plinky.com
  15. Caution Associations Ahead • define cross repository belongs repository(:key) do belongs_to :model end • define cross repository has has n, :models, :repository => repository(:key) Wesley Beary | Software Engineer | wesley@plinky.com
  16. Play along at home! http://github.com/monki/muddle Wesley Beary | Software Engineer | wesley@plinky.com
  17. Questions? http://github.com/monki/muddle Wesley Beary | Software Engineer | wesley@plinky.com

+ geemusgeemus, 2 years ago

custom

1421 views, 1 favs, 0 embeds more stats

CouchDB is a RESTful JSON eating beast of a documen more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 1421
    • 1421 on SlideShare
    • 0 from embeds
  • Comments 2
  • Favorites 1
  • Downloads 40
Most viewed embeds

more

All embeds

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories

Tags