scalable architecture for lucee app

122 views
Skip to first unread message

Brian FitzGerald

unread,
Feb 15, 2016, 4:51:50 PM2/15/16
to Lucee
Hey guys,

My app is currently running on Railo and I would like move it to Lucee. In doing so, I am also getting into Docker and exploring setting up my Lucee application to run on Amazon's EC2 container service or on DigitalOcean. I have some high level questions for anyone who has any experience running a Lucee app in containers, or at least has a better understanding of how Lucee works than I do (so in that case, pretty much all of you haha). My goal is to get away from my current single VPS server approach (in production) and have a horizontally scalable architecture for my application.

1) Would it make sense to have Apache or Nginx serve as the load balancer (routing request to one of many "Lucee" containers/boxes)? I'm thinking yes, but I'm not experienced in this area.
2) Would it ever make sense to have Lucee and Tomcat running on different containers or boxes from each other? My understanding of "proper" containerization is that having each service broken onto it's own container is the correct approach. It seems odd to me to have Tomcat and Lucee on different containers, but I'm not experienced in this area either. Thoughts?
3) Assuming you wanted to support lots of concurrent users, would it be reasonable to have all your Lucee/Tomcat instances talking to a single db layer/container in MySQL, or would another approach be recommended?

Thanks for your insight,
Brian

Nando Breiter

unread,
Feb 15, 2016, 5:48:07 PM2/15/16
to lu...@googlegroups.com
I don't have "the" answer, but having experienced the recent sustained DDoS attack on Linode, "scalable" should ideally avoid a single point of failure. It's dead easy to setup Nginx for load balancing, but unless you incorporate robust DNS failover into the mix, your load balancer is going to be the most vulnerable link. 

I also looked into CloudFlare and Fastly during the attack  - perhaps a CDN might be worthwhile to consider.





Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamedia

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/30035782-e66f-4451-8c04-8bcde2959421%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian FitzGerald

unread,
Feb 16, 2016, 10:26:01 AM2/16/16
to Lucee
Thank you Nando! Your insight is always very much appreciated. I will need to read-up on DNS failovers, but I see what you mean about the load balancer being the most vulnerable link. I appreciate you giving me a heads up on that.

Regarding all those other questions, I realize I'm asking a lot - probably too much. Let me highlight the biggest question mark for me and see if I can prompt some further insight... have you ever run (or considered running) Tomcat and Lucee on separate containers (or vm's, or physical machines), or in your opinion should they always be run within the same environment?

Best,
Brian

Nando Breiter

unread,
Feb 16, 2016, 10:49:28 AM2/16/16
to lu...@googlegroups.com
 Let me highlight the biggest question mark for me and see if I can prompt some further insight... have you ever run (or considered running) Tomcat and Lucee on separate containers (or vm's, or physical machines), or in your opinion should they always be run within the same environment?

In my completely naive opinion, they should always be run within the same environment ;-) Why would you want them in separate environments ( if it is possible ... )?

By the way, regarding your question 3 about MySql, you could take a look at Google Cloud Sql ... https://cloud.google.com/sql/docs/introduction , which is a relatively painless way to achieve "data replication between multiple zones with automatic failover" when using MySql. 





 

Igal @ Lucee.org

unread,
Feb 16, 2016, 11:55:42 AM2/16/16
to lu...@googlegroups.com
Lucee is a Java Servlet.  Java Servlets run inside Servlet Containers.  Tomcat is a Servlet Container.  Therefore -- Lucee runs inside Tomcat which runs inside a JVM

Not sure what you want to separate...?

Igal Sapir
Lucee Core Developer
Lucee.org

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Mark Drew

unread,
Feb 16, 2016, 12:03:40 PM2/16/16
to lucee
He means whether he should separate the web server (nginx/apache) and put it in a different machine/VM/Container than Tomcat. 

MD 

Igal @ Lucee.org

unread,
Feb 16, 2016, 12:09:01 PM2/16/16
to lu...@googlegroups.com
oh, well.  that's a matter of how much resources he's got, and how much traffic he gets.  if he has lots of both then sure -- put them on separate machines, but in most cases that is not needed IMO.


Igal Sapir
Lucee Core Developer
Lucee.org

Harry Klein

unread,
Feb 16, 2016, 12:11:12 PM2/16/16
to lu...@googlegroups.com

Maybe he meant this kind of distributed environment?

http://blogs.coldfusion.com/post.cfm/setting-up-coldfusion-in-distributed-envionment

 

-Harry

Brian FitzGerald

unread,
Feb 16, 2016, 12:44:21 PM2/16/16
to Lucee
Hey guys,

I really appreciate you all chiming in; you're awesome. Actually, I am NOT talking about separating nginx (or apache) and lucee/tomcat, that I am already reasonably sure I will end up doing. Igal was right to be confused in that I am indeed talking about the possibility of separating Lucee itself and Tomcat onto separate servers/docker containers (with the intention of executing a microservice architecture for better scalability and performance).

I am a cfml and javascript developer, and a Java neophyte, so I don't have a good understanding of the separation of the responsibilities of Lucee and Tomcat under the hood. However, I do have a nice app running on Railo which I am planning to port to Lucee (and onto Amazon's Elastic Beanstalk or EC2 Container platform). As part of this process, I have been looking at wanting to setup the application for horizontal scalability. So...

I have an associate who is very skilled with Docker and microservice architecture and, working for Oracle, he has considerable experience delivering very high traffic, mission-critical applications. With that in mind, his initial reaction when I was explaining my stack to him was that all components should be split into their own docker containers, even down to the finely-grained layer of separating the Lucee servlet and the Tomcat servlet container. This sounded unnecessary (and perhaps impossible) to me, but as I said, I am not very knowledgeable in this area.

So then, based on this discussion, it sounds to me like Lucee and Tomcat should ALWAYS live together in the same environment/server/vm/docker container (regardless of the scale of your application), and only the web layer (apache or nginx) and db should be split out on their own layers.

So it would be:
  • layer 1) web layer (apache or nginx serving as load balancer)
  • layer 2) app layer (multiple instances of lucee and tomcat together on each instance serving the application)
  • layer 3) db layer (MySQL serving db access).

Does this sound correct to you?

Thanks again,
Brian

Igal @ Lucee.org

unread,
Feb 16, 2016, 1:02:35 PM2/16/16
to lu...@googlegroups.com
it sounds to me like Lucee and Tomcat should ALWAYS live together in the same environment/server/vm/docker container (regardless of the scale of your application)
right, because as I wrote in the previous email -- Lucee runs inside Tomcat.  Tomcat, as a servlet container, provides APIs and infrastructure to Lucee which enables it to work properly.  while you could, theoretically, separate the two, it would make no sense to do so as many things will work differently than they should (some features will probably not work at all), and everything will run much slower due to latency involved with communicating between the two containers.


So it would be:
  • layer 1) web layer (apache or nginx serving as load balancer)
  • layer 2) app layer (multiple instances of lucee and tomcat together on each instance serving the application)
  • layer 3) db layer (MySQL serving db access).
that would work.  if you feel a need, and can afford it, you might want to add a load balancer as mentioned earlier in the thread, a firewall appliance (can be the same appliance as the LB), cluster session management if you use sessions, and database replication with failover in case the primary fails.


Igal Sapir
Lucee Core Developer
Lucee.org

Brian FitzGerald

unread,
Feb 16, 2016, 2:27:16 PM2/16/16
to Lucee
Got it, thanks a lot Igal, Nando, Mark and Harry! Long live Lucee :)
Reply all
Reply to author
Forward
0 new messages