Nowadays in this performance driven IT world, sometimes it is quite important to build a cluster of several application servers in order to meet the requirements in uptime or response time. So you might build your cluster containing several Railo application servers which manage the load or act as the reliability system. These clusters might grow large over time and they are very often configured identically in order to serve the load that comes in for a certain application. Then it is necessary to keep the systems in a synchronous state, especially when it comes to the settings of your CFML engine.
You might distribute configuration files or distribute other XML files or similar and always restart the engine, but Railo 3.0 offers a much better way of doing this. You can connect two Railo instances (or even web contexts) and keep them synchronous. Very important to know is, that the servers do not need to be in the same network. If they can talk over port 80, it might even be that they are only available throughout the internet somehow.
More on this feature in a future blog entry and here.
Important to know is that all the synchronization information survives server crashes, since it makes use of the new Railo Task Manager.
With Railo 3.0 we introduce a new scope called "cluster". It can be used to share data amongst two distant servers. This can be used in order to share information between two servers. It is quite easy to use this new scope. Just use it as any other scope:
server 1:on each servers the dump would look like this:
<cfset cluster.lastUpdated.server1 = CreateDateTime(2008, 09, 09, 12, 0, 0)>
<cfset cluster.lastUpdated.server2 = CreateDateTime(2008, 09, 09, 13, 34, 12)>
The cluster scope also makes use of the Railo Task Manager and therefore survives server crashes as well. Read more about the cluster scope and how to define it either on our website or in this >blog entry.
New & improved tags and functions
Here's a list of all new or improved tags and functions we introduced in Railo 3.0: Functions:
- imageDrawImage (draws an image over an image)
- arrayContains, arrayContainsNoCase
- dayOfWeekShortAsString, monthShortAsString
- dump (supports all CF8 attributes as arguments)
- GetFileInfo - support for attributes: isArchive, isSystem, scheme, isCaseSensitive, isAttributesSupported, isModeSupported
- FileExists - support of file objects created by fileOpen
I especially would like to mention the two last functions. The function getCurrenctContext returns an array containing the call stack. So if you would do a <cfdump eval=getCurrentContext()> you might get something like this:
The second function accepts a new boolean parameter which tells Railo to return an array of all scopes (scope precedence) that contain a variable with the passed name. So the name needs to be a string:
<cffunction name="myTest" output="Yes">
<cfset variables.myVar = "test">
<cfset url.myVar = "urlTest">
<cfset form.myVar = "formTest">
<cfset cookie.myVar = "cookieTest">
<cfset client.myVar = "clientTest">
<cfset var myVar = "localTest">
<cfdump var="#getMetaData("myVar", true)#">
This will output the following:
- CFVIDEO, CFVIDEOPLAYER, CFVIDEOPLAYERPARAM - will be part of the next blog entry
- cfapplication (attribute mappings, customtags) - more info here
- cfdbInfo (type users)
- cfdocument (attribute htmlbookmark) - more info here
- cffunction (returnformat="serialize")
- cfhttp (addtoken = yes)
- cfpdf (attribute filter and many other improvements)
- cfthread (attribute type, retryinterval) - more on that in part 4 of this blog
In Railo 3.0 we introduced some new additional operators that might make your life a little easier. Next to the short notation introduced in CF8 and CF 8.0.1 we have the following improvements in Railo 3.0:
- i != j is equal to i neq j
- i == j is equal to i eq j
- i === j means i and j are the same instance of a variable
- i !== j means i and j are two different variable instances
- i <= j is equal to i lte j
- i <> j is equal to i neq j
- s &= "string" is equal to s = s & "string"