Caballero
Caballero

Reputation: 12111

Play framework 2.2 "hot fixing" live production server

I'm fiddling around with Play Framework 2.2, trying various scenarios and coming from LAMP environment I have this question: is some form of hot fixing possible on live production server? If so, how exactly does it work? If no, then what is the closest thing?

Server OS is Centos 6.4. Equivalent example in LAMP would be re-uploading some file with a hot fix.

Upvotes: 0

Views: 265

Answers (2)

aaberg
aaberg

Reputation: 2273

You cannot hot fix a play framework application like you would a php application. Everything in a play framework application is compiled, so if you hot-switch one of your files on the server, the change will not have any affect before it is compiled and the server is restarted.

Instead of hot fixing, consider having a reverse proxy in front of your play application (Apache and Nginx are good alternatives). When you need to update your application, just upload it to a new folder and start it with a new port number. When the new server instance is up and running, switch the reverse proxy to point at the new instance. Then shut the old instance down.

With this approach, you can safely update your server without downtime.

Upvotes: 5

James Roper
James Roper

Reputation: 12850

This is not possible with Play (or most other web frameworks for that matter). To allow zero time deploys, you typically have a load balancer, and then do rolling upgrades across your nodes, taking one node at a time out of the cluster to upgrade it.

Upvotes: 2

Related Questions