Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

add framework for multiple data driver support. #438

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

add framework for multiple data driver support. #438

wants to merge 3 commits into from

Conversation

thehunmonkgroup
Copy link
Contributor

  • adds new setting UNHANGOUT_DB_DRIVER, for specifying which database
    driver to use
  • adds a driver for couchdb
  • cleans up an error in variable handling during user deserialization
  • renames the google _json key, to be both more clear and compatible
    with couchdb driver

@thehunmonkgroup
Copy link
Contributor Author

Note that this patch also leaves farmed Hangout URLs in redis. It would certainly be possible to also store those in a driver-dependent fashion, and, it seems fine to let redis manage them, as they are basically the kind of transient data that redis is well suited for.

@yourcelf
Copy link
Collaborator

yourcelf commented Sep 2, 2015

This is awesome, and something that's been on our roadmap for far too long without action.

A question on this: currently, a whole lot of the codebase assumes that the entire db will remain in memory, and will only be persisted to the backend so that it can be restored if the server reboots -- e.g. anywhere in the codebase that calls db.users.get is assuming a synchronous, in-memory backbone collection that contains the everything. Is this model one that you're striving to keep for now, or are you interested in a more foundational introduction of a real DB?

@thehunmonkgroup
Copy link
Contributor Author

I'm not a fan of the current 'load everything' approach, and, long term, would prefer a more traditional DB structure. That said, doing so would require a bit more work, and it's not work I'd do without a discussion first. This provides a positive first step to abstract for different database drivers, and a good deal of the code here can be re-used if and when that deeper refactor happens.

I would advocate committing this patch and immediately switching to CouchDB for most installations -- it's much better suited for the data structure, is ACID-compliant, and provides a built-in web interface for working with the stored data. Redis is left to handle transient data, which it is much more well-suited for.

 - adds new setting UNHANGOUT_DB_DRIVER, for specifying which database
   driver to use
 - adds a driver for couchdb
 - cleans up an error in variable handling during user deserialization
 - renames the google _json key, to be both more clear and compatible
   with couchdb driver
@thehunmonkgroup
Copy link
Contributor Author

Cleaned up one remaining architectural issue: the driver now takes the Unhangout database object as an argument, instead being merged with it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants