Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Microservices Evolution: Breaking your monolithic database

Edson Yanaga
September 18, 2016

Microservices Evolution: Breaking your monolithic database

Microservices are the current "big thing" and most of the current technologies seems to be a fit for greenfield projects. Unfortunately the great majority of developers can't build something from scratch and have a big legacy database with multiple relationships. The code usually is the easy part. The question that every enterprise developer asks is: what about my database?

Come to this session to learn the required database refactorings, architecture and deployment strategies that will enable you to split your big monolithic database into Microservices. And downtime is not an option! We'll show how we need to encompass code, architecture, DevOps and infrastructure altogether to accomplish this awesome evolution of your application with your database.

Edson Yanaga

September 18, 2016
Tweet

More Decks by Edson Yanaga

Other Decks in Technology

Transcript

  1. Join developers.redhat.com ALTER TABLE customers ADD COLUMN correct VARCHAR(20); UPDATE

    customers SET correct = wrong WHERE id < 100; UPDATE customers SET correct = wrong WHERE id < 200; <code update> <code update> <code update> (later…)ALTER TABLE customers DELETE COLUMN wrong; 27
  2. Join developers.redhat.com 28 Scenarios Add a Column Rename a Column

    Change Type/Format of a Column Delete a Column
  3. Join developers.redhat.com 29 Add a Column 1 ADD COLUMN 2

    NULL/DEFAULT Value/Computed Value 3 Use Column
  4. Join developers.redhat.com 30 Rename a Column 1 ADD COLUMN 2

    Code reads from the old column and writes to both 3 Copy data using small shards 4 Code reads from the new column and writes to both 5 Code reads and writes from the new column 6 Delete the old column
  5. Join developers.redhat.com 31 Change Type/Format of a Column 1 ADD

    COLUMN 2 Code reads from the old column and writes to both 3 Copy data using small shards 4 Code reads from the new column and writes to both 5 Code reads and writes from the new column 6 Delete the old column
  6. Join developers.redhat.com 32 Delete a Column 1 DON’T 2 Stop

    using the read value but keep writing to the column 3 Delete the column
  7. Join developers.redhat.com 42 Scenarios View Materialized View Mirror Table using

    Trigger Mirror Table using Transactional Code Mirror Table using ETL tools Event Sourcing
  8. Join developers.redhat.com 43 View Easiest one Largest support Possible performance

    issues Strong Consistency One database must be reachable by the other DBLink Updatable (?)
  9. Join developers.redhat.com 44 Materialized View Better performance Strong or Eventual

    Consistency One database must be reachable by the other DBLink Updatable (?)
  10. Join developers.redhat.com 45 Mirror Table using Trigger Depends on Database

    Support Strong Consistency One database must be reachable by the other DBLink
  11. Join developers.redhat.com 46 Mirror Table using Transactional Code *Any* code

    Strong Consistency Stored Procedures or Distributed Transactions Cohesion and coupling issues Updatable (?)
  12. Join developers.redhat.com 47 Mirror Table using ETL Lots of available

    tools Requires external trigger (usually time-based) Can aggregate from multiple datasources Read Only
  13. Join developers.redhat.com 48 Event Sourcing State of data is a

    stream of events Eases auditing Eventual Consistency Distributable stream through a Message Bus