You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion

ColdFusion: Article

When One ColdFusion Is Not Enough

When One ColdFusion Is Not Enough

By now, every ColdFusion developer knows, or should know, that ColdFusion MX sits on top of underlying Java architecture. Some ColdFusion developers have even been brave enough to attempt ColdFusion/Java integration, creating applications that leverage Java code where appropriate. But most developers are failing to take advantage of what is undoubtedly the most significant benefit of ColdFusion on top of J2EE, a benefit so important that for some organizations it has become the only reason needed to upgrade.

Understanding the Problem
Have you ever run into any of these situations?

  • Your ColdFusion application is running perfectly. That is, until someone else (no, not you) writes really poor code that kills performance or worse, hurts all the applications including yours in the process.
  • You have several applications on your server, and want to apply a product update to some of them (the ones you have tested against) but not others.
  • You host applications for multiple departments or clients on the same server, but can't give developers access to the ColdFusion Administrator for fear that they'll tamper with each other's settings.
  • Or for that matter, you want to have different ColdFusion Administrator settings for different applications (trusted cache, custom tag paths, site-wide error handlers, and more).
  • You don't have multiple physical servers, but still want to provide failover in case your application goes down.

    The common problem in all of these situations is that there is one shared copy of ColdFusion on any given server. All settings are shared, all paths are shared, all data sources are shared, all updates are shared, and even all bad code (or the results thereof) is shared.

    There is really only one solution to this problem. Each application needs to have its own ColdFusion. That way applications won't interfere with each other. It's as simple as that. Of course, that requires buying lots of servers and lots of copies of ColdFusion, right? Wrong. Read on.

    Is There a Single Server Solution?
    At DevCon 2001 in Orlando, I publicly demonstrated the following:

  • I wrote CFML code that would throw ColdFusion into an endless loop (no easy task mind you).
  • I ran that code and showed that ColdFusion was no longer responding to requests properly.
  • I then opened another browser window and requested a ColdFusion page from the same server, and it loaded perfectly (even though the first page was still stuck and not responding).

    The trick? There wasn't one. What I demonstrated was all real, no smoke and mirrors. The reason it worked is that I had more than one copy of ColdFusion installed on my computer, it's as simple as that.

    Well, maybe not so simple. It did take us longer to deliver this functionality than we had originally planned, but with ColdFusion MX for J2EE we have indeed delivered the ability to run multiple instances of ColdFusion on a single server.

    Understanding Multiple Instances
    J2EE servers are application servers, they serve applications, and usually lots of them. In a J2EE world, applications are deployed onto a J2EE server, and each Java application lives in a safe and isolated environment. Each Java application is treated as if it were running on its own server - applications can be stopped, started, upgraded, tweaked, and managed entirely independent of any other Java application. In fact, the same Java application may be deployed multiple times on the same J2EE server, and each instance of that same application can also be stopped, started, upgraded, tweaked, and managed entirely independent of any other instances of that same Java application.

    What has this to do with ColdFusion? ColdFusion MX is actually not a server; technically it's an application, a Java application that runs on top of a J2EE server. And like any Java application running on a J2EE server, you may deploy multiple instances of ColdFusion MX on the same physical hardware, multiple instances that are entirely independent of each other.

    The Benefits
    What are the benefits of running multiple instances of ColdFusion MX on J2EE? There are lots, some obvious and some less so:

  • A ColdFusion instance cannot step on the feet of any other ColdFusion instance. That bad SQL statement that someone else wrote need no longer hurt the performance of your application.
  • Each ColdFusion instance has its own ColdFusion Administrator and its own ColdFusion settings. The owner of each ColdFusion instance can safely make ColdFusion Administrator changes that will not affect other instances.
  • ColdFusion instances can be upgraded independent of each other.
  • Multiple instances are more secure than a single shared instance.
  • Most J2EE servers (including Macromedia JRun) allow you to cluster instances on the same box. In other words, you can have multiple copies of the same ColdFusion application (each running in a separate ColdFusion instance) on the same machine, and cluster them so that you have application failover on a single box.
  • ColdFusion even allows the SESSION scope to be clustered. In the past (ColdFusion 4 and 5) it was close to impossible to use SESSION and clustering at the same time. You either had to use CLIENT variables and write them to a shared database, or use some sort of sticky IP to essentially prevent clustering while a SESSION was active. ColdFusion MX on top of J2EE leverages Java sessions that can be clustered (on some J2EE servers). As such, ColdFusion SESSION variables (with the notable exception of CFCs) can be shared across ColdFusion instances (on the same box or even on different boxes).

    In other words, you get all the functional benefits that you'd get by running ColdFusion on multiple servers (without needing multiple servers), you get the ability to cluster your applications even on a single box, you get dramatically improved session state support in clusters, and the best part is... you don't need to buy a copy of ColdFusion for each instance. The ColdFusion license allows for as many instances as you'd like on the same server. So, you get all of the listed benefits, and cost savings too.

    So, How Many Instances?
    Now that you know that you can create as many instances as you'd like, the next question is, should you? You can use ColdFusion MX for J2EE as you do standalone ColdFusion, lots of applications in a shared instance. You can also create multiple instances. Or you can do both.

    I've already listed all the pros to creating multiple instances of ColdFusion, but there is an important con - each instance is a full ColdFusion install running a full version of ColdFusion. As such, each additional instance requires additional system resources, about 100MB RAM (or so) per instance. RAM is pretty cheap nowadays, but even so, having hundreds of instances is probably very impractical. (An ISP, for example, hosting several hundred ColdFusion clients on a single box, will probably not create an instance for each and every client.)

    The ideal number of instances is really dependent on your application and needs. You may have applications that can share an instance. You may have some applications that need their own instances. You may even have applications that each require multiple instances. The key is that you have the flexibility to do whatever works best for you. ColdFusion supports it, and makes it remarkably cost effective too.

    Getting Started By now you probably do not need any more convincing of the value of ColdFusion of top of J2EE. If you are itching to get started, here are some things to keep in mind:

  • Obviously, you'll need a J2EE server. Popular choices include IBM WebSphere, BEA WebLogic, Sun ONE, and our own Macromedia JRun. If you are not yet running a J2EE server then look at JRun - not only is it the most economical commercial J2EE implementation, you'll also find it to be the easiest to install and configure.
  • Once you're running a J2EE server you'll need to install ColdFusion on top of it. Installing ColdFusion for J2EE is very different from installing standalone ColdFusion. J2EE applications are installed using special files (EAR or WAR files) that contain entire applications. These files are expanded and processed by management software provided with the J2EE server (and each J2EE is different of course). The process of installing ColdFusion involves running the ColdFusion installer program which creates an EAR or WAR file, and then using the J2EE server management tools to deploy the created EAR or WAR file.
  • For what it's worth, servers like JRun will allow you to deploy ColdFusion as an EAR file or as a WAR file. EAR files can contain more resources than a WAR file can, but that's not really relevant to ColdFusion installs. From a ColdFusion perspective, the advantage to using WAR files is that using an EAR file you'd need to run the ColdFusion installer to generate a unique EAR file for each instance, and using WAR files you can reuse the same WAR file repeatedly.
  • When you install a J2EE application (an EAR or a WAR) it's installed into a virtual path called a context root. So, path http://myserver/app1/ would point to the app1 context root, and http://myserver/app2 would point to the app2 context root. It is the context root in a URL that tells the J2EE server which application to use. Each application (and thus each instance of ColdFusion) goes into its own context root. If you are deploying a WAR file the management interface will prompt for the context root to use at deployment time. If you are deploying an EAR file then the ColdFusion installer will prompt for the context root, which will be embedded in the EAR file itself (this is why I said that using WAR files to deploy ColdFusion is advantageous in that the same WAR file could be used for each instance).
  • It is possible to have ColdFusion MX run in the default context (/ without a specified context root in every URL). The exact steps to configure this vary based on the J2EE server being used, so consult your J2EE server documentation.
  • Most J2EE servers (including JRun) allow application instances to be bound to different virtual hosts so that you do not need to always use the context root. Unfortunately, this tends to be very J2EE implementation specific, so consult your J2EE server documentation. JRun, for example, supports the ability to deploy multiple applications at the default context path so long as each is deployed into a different virtual host.
  • Each instance of ColdFusion gets its own copy of the ColdFusion Administrator, Flash Remoting, and other ColdFusion features and technologies. To invoke the correct ColdFusion Administrator, for example, you just need to be sure to use the right context root in the URL.
  • Clustering J2EE applications is also very J2EE implementation specific. JRun, for example, comes with an interface called the JMC (JRun Management Console), which has a series of screens that walk you through cluster creation. Again, consult your J2EE server documentation.

    If all this sounds foreign to you, don't panic. While installing and configuring ColdFusion on top of J2EE is not (and cannot be) as simple as installing standalone ColdFusion, it's actually not that painful either (especially if you are running JRun). And Macromedia is committed to making the process even easier in the future.

    ColdFusion now comes in two distinct flavors, standalone ColdFusion and ColdFusion for J2EE. Although all versions of ColdFusion run on top of J2EE servers (standalone ColdFusion has a scaled down version of JRun embedded within it), the ability to run multiple instances requires ColdFusion on top of a J2EE server. For many organizations, the security, scalability, stability, manageability, and cost savings of running multiple instances of ColdFusion are the compelling reasons to upgrade not just to ColdFusion MX, but to ColdFusion MX for J2EE.

    This entire discussion pertains to Coldfusion MX for J2EE. Standalone Coldfusion does not support the running of multiple instances on a single server.

  • More Stories By Ben Forta

    Ben Forta is Adobe's Senior Technical Evangelist. In that capacity he spends a considerable amount of time talking and writing about Adobe products (with an emphasis on ColdFusion and Flex), and providing feedback to help shape the future direction of the products. By the way, if you are not yet a ColdFusion user, you should be. It is an incredible product, and is truly deserving of all the praise it has been receiving. In a prior life he was a ColdFusion customer (he wrote one of the first large high visibility web sites using the product) and was so impressed he ended up working for the company that created it (Allaire). Ben is also the author of books on ColdFusion, SQL, Windows 2000, JSP, WAP, Regular Expressions, and more. Before joining Adobe (well, Allaire actually, and then Macromedia and Allaire merged, and then Adobe bought Macromedia) he helped found a company called Car.com which provides automotive services (buy a car, sell a car, etc) over the Web. Car.com (including Stoneage) is one of the largest automotive web sites out there, was written entirely in ColdFusion, and is now owned by Auto-By-Tel.

    Comments (1) View Comments

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

    Most Recent Comments
    Peter Edd 07/16/03 04:48:00 PM EDT

    I've been reluctant to install CFMX as I've heard all too often that it doesn't do that well in a shared server environment. Does this mean that I should be able to run CF5 while installing an instance of CFMX on top of our JRUN server software??

    @ThingsExpo Stories
    Detecting internal user threats in the Big Data eco-system is challenging and cumbersome. Many organizations monitor internal usage of the Big Data eco-system using a set of alerts. This is not a scalable process given the increase in the number of alerts with the accelerating growth in data volume and user base. Organizations are increasingly leveraging machine learning to monitor only those data elements that are sensitive and critical, autonomously establish monitoring policies, and to detect...
    To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. Jack Norris reviews best practices to show how companies develop, deploy, and dynamically update these applications and how this data-first...
    Intelligent Automation is now one of the key business imperatives for CIOs and CISOs impacting all areas of business today. In his session at 21st Cloud Expo, Brian Boeggeman, VP Alliances & Partnerships at Ayehu, will talk about how business value is created and delivered through intelligent automation to today’s enterprises. The open ecosystem platform approach toward Intelligent Automation that Ayehu delivers to the market is core to enabling the creation of the self-driving enterprise.
    SYS-CON Events announced today that Grape Up will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct. 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company specializing in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the U.S. and Europe, Grape Up works with a variety of customers from emergi...
    "We're a cybersecurity firm that specializes in engineering security solutions both at the software and hardware level. Security cannot be an after-the-fact afterthought, which is what it's become," stated Richard Blech, Chief Executive Officer at Secure Channels, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA.
    Consumers increasingly expect their electronic "things" to be connected to smart phones, tablets and the Internet. When that thing happens to be a medical device, the risks and benefits of connectivity must be carefully weighed. Once the decision is made that connecting the device is beneficial, medical device manufacturers must design their products to maintain patient safety and prevent compromised personal health information in the face of cybersecurity threats. In his session at @ThingsExpo...
    SYS-CON Events announced today that Massive Networks will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Massive Networks mission is simple. To help your business operate seamlessly with fast, reliable, and secure internet and network solutions. Improve your customer's experience with outstanding connections to your cloud.
    Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution and join Akvelon expert and IoT industry leader, Sergey Grebnov, in his session at @ThingsExpo, for an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
    Because IoT devices are deployed in mission-critical environments more than ever before, it’s increasingly imperative they be truly smart. IoT sensors simply stockpiling data isn’t useful. IoT must be artificially and naturally intelligent in order to provide more value In his session at @ThingsExpo, John Crupi, Vice President and Engineering System Architect at Greenwave Systems, will discuss how IoT artificial intelligence (AI) can be carried out via edge analytics and machine learning techn...
    When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
    SYS-CON Events announced today that Datera, that offers a radically new data management architecture, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Datera is transforming the traditional datacenter model through modern cloud simplicity. The technology industry is at another major inflection point. The rise of mobile, the Internet of Things, data storage and Big...
    SYS-CON Events announced today that GrapeUp, the leading provider of rapid product development at the speed of business, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market acr...
    In the enterprise today, connected IoT devices are everywhere – both inside and outside corporate environments. The need to identify, manage, control and secure a quickly growing web of connections and outside devices is making the already challenging task of security even more important, and onerous. In his session at @ThingsExpo, Rich Boyer, CISO and Chief Architect for Security at NTT i3, discussed new ways of thinking and the approaches needed to address the emerging challenges of security i...
    SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business - from apparel to energy - is being rewritten by software. From planning to development to management to security, CA creates software that fuels transformation for companies in the applic...
    In his opening keynote at 20th Cloud Expo, Michael Maximilien, Research Scientist, Architect, and Engineer at IBM, discussed the full potential of the cloud and social data requires artificial intelligence. By mixing Cloud Foundry and the rich set of Watson services, IBM's Bluemix is the best cloud operating system for enterprises today, providing rapid development and deployment of applications that can take advantage of the rich catalog of Watson services to help drive insights from the vast t...
    There is only one world-class Cloud event on earth, and that is Cloud Expo – which returns to Silicon Valley for the 21st Cloud Expo at the Santa Clara Convention Center, October 31 - November 2, 2017. Every Global 2000 enterprise in the world is now integrating cloud computing in some form into its IT development and operations. Midsize and small businesses are also migrating to the cloud in increasing numbers. Companies are each developing their unique mix of cloud technologies and service...
    WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, will introduce two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a...
    Recently, IoT seems emerging as a solution vehicle for data analytics on real-world scenarios from setting a room temperature setting to predicting a component failure of an aircraft. Compared with developing an application or deploying a cloud service, is an IoT solution unique? If so, how? How does a typical IoT solution architecture consist? And what are the essential components and how are they relevant to each other? How does the security play out? What are the best practices in formulating...
    Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...
    In his session at @ThingsExpo, Arvind Radhakrishnen discussed how IoT offers new business models in banking and financial services organizations with the capability to revolutionize products, payments, channels, business processes and asset management built on strong architectural foundation. The following topics were covered: How IoT stands to impact various business parameters including customer experience, cost and risk management within BFS organizations.