Skip to content

vsergiienko/multi-db-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLAlchemy 1.4 Enabling Two-Phase Commit PoC

Setup

pip install -r requirements.txt
  • to run two DBs:
make run
  • to clean DBs:
make clean
  • to stop DBs:
make stop
  • DDLs:
python init_schema.py --help
  • The script:
python main.py --help

Break schema

⚠️ required for 1st strategy (combined session)

This command will create different schema for Account (name replaced with full_name) in second database. When you try to commit regular Account with field name it'll throw an error because account table does not have such column.

python init_schema.py --break-schema

Flow example

Happy path ✅

  • for first run
make run
  • if it's already been run
make clean
python init_schema.py
python main.py --strategy 1

Error case ❌

  • for first run
make run
  • if it's already been run
make clean
python init_schema.py --break-schema
python main.py --strategy 1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published