Life Beyond Distributed Transactions: An Apostate's Implementation - Document Example

Posts in this series: A Primer Document Coordination Document Example Dispatching Example Failures and Retries Failure Recovery Sagas Relational Resources Sample code from this series In the last post, I walked through the "happy path" scenario of coordinated communication/activities between multiple resources that otherwise can't participate in a transaction. In this post, I'll walk through a code example of building out document coordination in Azure Cosmos DB. My starting [Read More]

Life Beyond Distributed Transactions: An Apostate's Implementation - Document Coordination

Posts in this series: A Primer Document Coordination Document Example Dispatching Example Failures and Retries Failure Recovery Sagas Relational Resources Sample code from this series Quick note - I've updated this post to use the more accurate term "Document" than the less-accurate, DDD-specific term "Aggregate". In the images, it still has the older term "Aggregate", let's pretend I fixed all those images. In the last post, I walked through the [Read More]

Life Beyond Distributed Transactions: An Apostate's Implementation - A Primer

Posts in this series: A Primer Document Coordination Document Example Dispatching Example Failures and Retries Failure Recovery Sagas Relational Resources Sample code from this series For those working with SQL databases, working with transactions is more or less a given. The most we may need to worry about is: Using the appropriate isolation level Not doing too much in a single transaction to prevent excessive locks The vast majority of [Read More]

Dealing With Optimistic Concurrency Control Collisions

Optimistic Concurrency Control (OCC) is a well-established solution for a rather old problem - handling two (or more) concurrent writes to a single object/resource/entity without losing writes. OCC works (typically) by including a timestamp as part of the record, and during a write, we read the timestamp: Begin: Record timestamp Modify: Read data and make tentative changes Validate: Check to see if the timestamp has changed Commit/Rollback: [Read More]

Swagger, the REST Kryptonite

Swagger, a tool to help design, build, document, and consume RESTful APIs is ironically kryptonite for building actual RESTful APIs. The battle over the term "REST" is lost, where "RESTful" simply means "an API over HTTP" but these days is 99% of the time referring to "RPC over HTTP". In a post covering the problems with Swagger, the author outlines some familiar issues I've seen with it (and its progenitors [Read More]