
When updating the application to a newer version, it is necessary to switch users over to the new version as quickly as possible with minimal delays and loss of requests. To solve this problem, different projects use different approaches. One of these approaches is to change the binding of the main domain to the environment with a newer version of the application.
How is the update process in this case? Very millet - you configure the full-fledged operation of the new version of the application in a separate environment, and then change the domain binding to another IP, or more simply switch the flow of users to the updated environment. Of course in this case will occur
problems with the cache DNS servers. Let's analyze what
Jelastic (Java Elastic Cloud Platform) offers for solving the problem of updating applications and how to get around the DNS cache problem.
Below is a step-by-step instruction on how to solve a similar problem with Jelastic.
First, create an environment. Let's call it
prod-v1 . In our case, this will be the environment with the server GlassFish 3.1. Let's create a simple HelloWorld.war project. Download it to the Deploy Manager and deploy it to our environment.

')
We tie an external domain to our application. For example, suppose I bought
extdomain.org . linked to the
prod-v1.jelastic.com domain
Now we will park the domain in an environment.

We check the binding of the domain to the environment

Everything went well.
We did the standard operations to bind the external domain to the application.
Next comes the fun part.Let's make changes to our application, we will create its newer updated version.
Load it into the deployment manager. Make a clone of the current environment entirely and call it
prod-v2 .

We will enclose the new version of our application in the newly cloned environment.

We check its performance and, if everything is ok, we can start changing the main productive version. To do this, open the environment settings panel and select the environment in the
Swap Domains area to change the external domain. In our case, this is
prod-v1.
Domain change takes place almost instantly and simultaneously for all users.

The problem with the DNS cache in this case is missing, because internal domain resolver is used, which is updated instantly.
To save resources, you can turn off the previous environment or simply delete it.
Plans for the further development of this functionality.
Next, we plan to implement a gradual (smooth) introduction to the system of the new application. Namely, balancing requests between the two environments, gradually increasing the flow of users to the new environment, while reducing the flow to the old, eventually reducing it completely to zero. Then it will be possible to “put out” the previous environment.
PS: Tomorrow is planned to release the next update Jelastic, in which
- support for JEE6 based on GlassFish 3.1.1 (now GF will be available to everyone)
- significantly improved log manager
- PostgreSQL update to version 8.4
Possible temporary unavailability of the control panel environments. However, this does not apply to your applications. All deployed applications will work without interruption.
Soon we will post the next update of the
documentation and
video .
You can
quickly track our news on
Twitter and on the Facebook page.