I'm looking into NoSQL for scaling alternatives to a database. What do I do if I want transaction-based things that are sensitive to these kind of things?
相关问题
- Autocommit with PDO
- MongoDB: groupby subdocument and count + add total
- how to handle null values on firebase transaction
- Does ObjectContext.Connection.BeginTransaction() u
- copying a very large table from one DB2 to another
相关文章
- Upgrading transaction.commit_manually() to Django
- How does Cassandra scale horizontally ?
- Modelling a Chat like Application in Firebase
- NoSQL Injection? (PHP->phpcassa->Cassandra)
- How do I get transaction info in Spring whether tr
- Using NHibernate transaction in SqlBulkCopy
- SeamPhaseListener - Could not start transaction -
- Subset of changes from transaction sometimes not v
This is the closest answer I found which would apply to any NoSQL database. It's on a 2007 blog post from Adam Wiggins of Heroku.com:
From: http://adam.heroku.com/past/2007/12/17/a_world_without_sql/ (His website is great for ideas on scalability.)
I interpreted the above paragraph as:
More info. on queues/background workers: http://adam.heroku.com/past/2009/4/14/building_a_queuebacked_feed_reader_part_1/
The client (aka member or customer) follows these steps to take out money:
You can use Heroku.com to create a small mock-up quickly if you are comfortable with Node.js or Ruby/Rack.
The general idea seems pretty easy and much better than using transactions baked into the database that make it super-hard to scale.
Disclaimer: I haven't implemented this in any way yet. I read about these things for curiosity even though I have no practical need for them. Yes, @gbn is right that a RDBMS with transactions would probably be sufficient for the needs of Timmy and me. Nevertheless, it would be fun to see how far you can take NoSQL databases with open-source tools and a how-to website called, "A Tornado of Razorblades".
have a look at scalaris its a no sql db with strong consistency and implemented transactions.
You can implement optimistic transactions on top of NoSQL solution if it supports compare-and-set. I wrote an example and some explanation on a GitHub page how to do it in MongoDB, but you can repeat it in any suitable NoSQL solution.
NoSQL covers a diverse set of tools and services, including key-value-, document, graph and wide-column stores. They usually try improving scalability of the data store, usually by distributing data processing. Transactions require ACID properties of how DBs perform user operations. ACID restricts how scalability can be improved: most of the NoSQL tools relax consistency criteria of the operatioins to get fault-tolerance and availability for scaling, which makes implementing ACID transactions very hard.
A commonly cited theoretical reasoning of distributed data stores is the CAP theorem: consistency, availability and partition tolerance cannot be achieved at the same time. SQL, NoSQL and NewSQL tools can be classified according to what they give up; a good figure might be found here.
A new, weaker set of requirements replacing ACID is BASE ("basically avalilable, soft state, eventual consistency"). However, eventually consistent tools ("eventually all accesses to an item will return the last updated value") are hardly acceptable in transactional applications like banking. Here a good idea would be to use in-memory, column-oriented and distributed SQL/ACID databases, for example VoltDB; I suggest looking at these "NewSQL" solutions.
You can always use a NoSQL approach in a SQL DB. NoSQL seems to generally use "key/value data stores": you can always implement this in your preferred RDBMS and hence keep the good stuff like transactions, ACID properties, support from your friendly DBA, etc, while realising the NoSQL performance and flexibility benefits, e.g. via a table such as
Bonus is you can add extra fields here to link your content into other, properly relational tables, while still keeping your bulky content in the main BLOB (or TEXT if apt) field.
Personally I favour a TEXT representation so you're not tied into a language for working with the data, e.g. using serialized Java means you can access the content from Perl for reporting, say. TEXT is also easier to debug and generally work with as a developer.