I am trying to analyze blue green deployment strategy to provide zero downtime upgrades for our customers. We have an enterprise java based monolithic web application that uses Oracle as the data store. There are a few challenges that I would like to get expert inputs
-
With every database object types (procedures, tables, indexes, constraints etc) we need special handling, most of them are stated here. This ultimately requires fine code handling for each and every use case.
-
With blue green deployments, how do we handle active user web sessions? Do we detect session close events?
The implementation effort for such an approach needs time (approximately an year as the post suggests) and fine care to make sure we get it right. Are there simpler and better alternatives to this?
Thanks!
Best Answer
Load Balancer
For the second point, use a suitable load balancer. You can shift a portion of the traffic across, first to prove the new deployment, then to slowly ramp it up. It also allows a quick backout strategy.
Database versioning
There are two ways to go about this:
In the first method, it might make sense to distance your application from the data-representation and move all data transfer via the stored procedures. This ensures a clean interface that can be ported forward. This allows the migration path to be like:
If this sounds too complex, or performs manipulation on live data is too dangerous then moving the definition of what is authoritive to another data source may be what you need. With this it no longer matters what is in the sql data store (unless it is storing the event log in which case except that part). Deployment now looks like:
Your application will have to double enter the data, first on the event log, then it will need to read the event log and update the associated table data. On the plus side this will allow several versions of the product to work together for a time at the cost of extra work.