Copy link to clipboard
Copied
Does anyone have any best practices for coding a high volume CF site?
What things do you want to watch out for?
Copy link to clipboard
Copied
What do you mean by "high volume"? Do you mean just pure user requests? If you are running into any specific issues what are those?
Copy link to clipboard
Copied
I'd use those things for any new site I was building today, whether high volume or otherwise.
Copy link to clipboard
Copied
Some great suggestion on here, and I certainly agree with all of the Framework level items. I would recommend building everything as service interfaces. This will have a lot of long term usage and allow you to scale (internal and external). Focus on building the best platform in order to get the best product. Lastly, I would use the API manager to manage the Services.
Copy link to clipboard
Copied
I agree with both of the responses above. One thing I would add is while you are building your services, consider coding them in a way that they are not tired directly to your main program. Code them in a way that if you decided to open up your service to external users it will be an easy transition. Having to recode an API down the line so they can be available to outside users can cause lots of issue. Plan now for future expansion and save yourself alot of trouble down the line.
Copy link to clipboard
Copied
All of these suggestions sound like good ideas to me. That said, the problems with poorly-scaling CF sites aren't that they didn't use this framework or that framework, or that they didn't embrace a microservices approach, etc. It's because they were poorly written, by developers who didn't necessarily understand that they were writing programs that would be executing in parallel rather than serially. And using frameworks and microservices by itself doesn't solve that problem.
For many years, I've reviewed CF programs that didn't work well, and the vast majority of times it was because they didn't interact with the database efficiently. Remember when you write a program that there will be n concurrent copies of your program running simultaneously. What will happen when they interact with the database? What kinds of blocking will be caused by this interaction? Have you tried load testing your program?
After you fix your database interactions, the best way you can improve your program's performance is by making it do less at the time a user makes a request. You might be able to do work before the request by caching, or do work after the request by queuing - but either is better than doing work during the request. If you're building an application that primarily shows data, take advantage of whatever caching mechanisms you have available: caching queries using CACHEDWITHIN/CACHEDAFTER, caching queries or various objects or snippets of generated content within memory variables or via CFCACHE, caching generated pages or AJAX call responses or whatever using edge caching, etc.