Transactions in NoSQL?

前端 未结 11 963
长情又很酷
长情又很酷 2020-12-22 18:39

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?

11条回答
  •  伪装坚强ぢ
    2020-12-22 19:34

    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

    CREATE TABLE MY_KEY_VALUE_DATA
    (
        id_content INTEGER PRIMARY KEY,
        b_content  BLOB
    );
    

    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.

提交回复
热议问题