Skip to content

Instantly share code, notes, and snippets.

@vishaltelangre
Last active August 27, 2017 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishaltelangre/f2019023a75e1fbac34e53a433e05d15 to your computer and use it in GitHub Desktop.
Save vishaltelangre/f2019023a75e1fbac34e53a433e05d15 to your computer and use it in GitHub Desktop.
Managing Data in Microservices - Notes

Link to the talk: https://www.infoq.com/presentations/microservices-data-centric

Notes:

  1. Service for each table

  2. Local/own/isolated database for each service

  3. Cache join query information locally on respective service's DBs on each write to avoid cascaded service calls (aka joins in monolithic/shared DB)

  4. Alternative to ACID transactions is to perform multi-step operations using a state machine which can be rollbacked

  5. Dealing with events
    5.1 At most once delivery - When you don't care about such events, like logging stuff using UDP
    5.2 At least once delivery - When you care about it, so it will retry if it doesn't get acknowledgment of delivery

    5.2.1 Receiving multiple times - Need consumer logic to be idempotent (which means it should yield same result if the same operation/function is performed multiple times, i.e. f(x) == f(f(x)) == f(f(f(f(x)))))

    5.2.2 Receiving out of order - Need CRDT data types (https://github.com/ericmoritz/crdt) or something, which for e.g. keeps the next one in memory for a while until the prior event is received

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment