Metadata-Version: 2.4
Name: ocyan.plugin.high_availability
Version: 0.1.1rc1
Summary: Primary/replica database router for Ocyan
Author: MandelBlog
License-Expression: LicenseRef-Proprietary
Classifier: Framework :: Django
Classifier: Environment :: Plugins
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <3.14,>=3.12
Description-Content-Type: text/markdown
Requires-Dist: ocyan.core
Requires-Dist: Django>=4.2

Ocyan plugin High availability
==============================
Installation
-------------
Add `ocyan.plugin.high_availability` to your projects dependencies.

About & Usage of High availability
----------------------------------
Make oscar and wagtail work in a high availability setup with a master and slave database

This router implements a primary/replica pattern: writes and reads inside an
atomic transaction stay on `default`; ordinary reads use `read` when configured;
sessions keep Django's default route; migrations are explicitly blocked on the
replica. It does not provision, replicate, monitor, or fail over databases.

If you enable a two-database primary/replica configuration, the consumer must
provide independent, read-only replica credentials and infrastructure. Do not
copy a mutable database configuration object or use this feature until replica
lag and failover behavior have been assessed for the application.

1. `default` must be the writable primary database.
   
   DATABASES["default"]["HOST"] = "192.168.1.3"
2. Define a separate `read` database configuration for the read-only replica,
   for example:
   
   DATABASES["read"] = {**DATABASES["default"], "HOST": "replica.internal"}

Run migrations only against `default`. Usually this is appropriate only after a
production primary/replica operational review.
