Devoxx France 2013 – Architecting for Continuous Delivery
At Devoxx France 2013, I attended to conference titled « Architecting for Continuous Delivery » presented by Axel Fontaine.
Facebook, Flickr and Stack Overflow are going in production many times per day and thus they do continuous delivery. Note : we can see that Stack Overflow’s version number is in the footer of pages.
Continuous delivery can’t be done from a snapshot version in order to allow reproducibility. So, the cycle is : run the tests, release a new version and deploy into the continuous delivery environment.
When the deployment is done manually, it must be automated. The deployed version must contain application binaries, differences between databases, as well as configuration for all environments (integration, acceptance test, production …). Environment detection must be automatic, by using an environment variable, a file located at a given place …
Management of database modifications
Axel advices to choose a tool managing database versions and execution order of scripts :
- Flyway is a free software for migration of databases. It records history of each played script. One can start from an existing database to generate the first version of scripts.
- Liquibase is another free software with similar features.
Management of features
Feature toggle allows to avoid creation of branches (and therefore merge of branches and duplication of continuous integration environments). It offen means adding a ‘if’ in the source code, which avoids breaking existing code. Old code will be removed later when everything will be ok in production.
Management of servers
In order to survive an eventual server crash and maintain a web site always on, 2 computers must be used.
While deploying in production, one computer is used for deployment of the new version, connected to the same database. Compatibility of the old server with the database must be ensured : instead of renaming a column, another one must be added together with a trigger copying the old column to the new one. The old column and the trigger will be dropped later. For a web application running under tomcat, usage of a shared session cache like memcached-session-manager allows to preserve active sessions. Each computer host a tomcat instance and a memcached instance. The switch to the new version is done totally transparently for users.
![[del.icio.us]](http://www.duminy.fr/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.duminy.fr/blog/wp-content/plugins/bookmarkify/digg.png)
![[Google]](http://www.duminy.fr/blog/wp-content/plugins/bookmarkify/google.png)
![[LinkedIn]](http://www.duminy.fr/blog/wp-content/plugins/bookmarkify/linkedin.png)
![[StumbleUpon]](http://www.duminy.fr/blog/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Windows Live]](http://www.duminy.fr/blog/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.duminy.fr/blog/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.duminy.fr/blog/wp-content/plugins/bookmarkify/email.png)




