SlideShare a Scribd company logo
1 of 65
Download to read offline
The Top 5 
Things You 
are doing 
today to 
hinder 
scalability 
Dan Wilson
Who is Dan 
Wilson 
 Runs ChallengeWave.com, 
Datacurl LLC and NCDevCon 
 Owner of Model-Glue 
 Dad of 2, Husband to 1 
 Loves all things technical 
and a good debate 
Gives bad stock tips
Our Top 5 List 
1.Monolithic Design 
2.Mis-identification/Misuse of shared 
resources 
3.Over-reliance on Shared Scopes 
4.Stupid Developer Tricks 
5.Failure to design for cacheability
Monolithic Design 
Credit: http://thecodelesscode.com/case/33
Solution: Partition Databases
Solution: Decouple Functionality
Shared Resources
Scalability Curve
Fun With Math
Cost of WebServer File 
Web Server Thread 
+ Network to File System 
+ Disk Wait Time 
+ Disk Seek Time 
+ Transfer time to Webserver 
+ Transfer time to complete HTTP Request 
______________________ 
Total Time
Cost of 1 ColdFusion File 
Web Server Cost 
+ Network Cost to CF Server 
+ CF Parsing or Classloading Time 
+ Thread Wait time 
+ Thread CPU time 
+ Transfer time for CF buffer to Webserver 
______________________ 
Total Time
Cost of ColdFusion File With Query 
Web Server Cost 
+ ColdFusion File Cost 
+ Number of Queries ( Network time to DB + Query 
Execution Plan + Query Execution + Disk Wait + Disk Seek ) 
+ Network time to transport result set to CF 
+ CF Parsing Time 
______________________ 
Total Time
Types of Shared Resources 
● Memory, CPU, Disk Space 
● Disk Transfer (Databases!!) 
● JVM Space 
● ColdFusion template cache 
● ColdFusion Threads 
● Network Traffic 
● Database/Data Store 
● Blah 
● Blah 
● Blah
DANGER! DANGER!
Over-reliance on Shared Scopes 
● Session Scope use is the largest culprit 
● Sometimes you have to deoptimize a few 
operations in order to provide a scalable 
solution (like stop caching a state query in application 
scope) 
● If you want to use a shared scope and want to 
keep an eye on scalability later, use a lookup 
factory.
But, what about sticky sessions?
Asymmetric Load
<cfcomponent> 
<cfset variables.instance = structNew() /> 
<cffunction name="init" returntype="CurrentUserLoader" output="false" 
access="public"> 
<cfargument name="UserService" type="any" required="true"/> 
<cfset variables.UserService = arguments.UserService /> 
<cfreturn this /> 
</cffunction> 
<cffunction name="destroy" output="false" access="public" returntype="void" > 
<cfset cookie.UserToken = "" /> 
<cfset structDelete( cookie, "UserToken") /> 
</cffunction> 
<cffunction name="load" output="false" access="public" returntype="any" hint=""> 
<cfset var loggedInUserToken = "" /> 
<cfif structkeyExists(cookie, "UserToken")> 
<cfset loggedInUserToken = cookie.UserToken /> 
</cfif> 
<cfreturn variables.UserService.loadUserByToken("User", loggedInUserToken ) /> 
</cffunction> 
<cffunction name="set" output="false" access="public" returntype="void" hint=""> 
<cfargument name="user" type="any" required="true"/> 
<cfset cookie.UserToken = arguments.User.getUserToken() /> 
</cffunction> 
</cfcomponent>
Make the Key 
<cfset UserToken = “#UserID#|” /> 
<cfset UserToken = UserToken & “MySharedSecret|” /> 
<cfset UserToken = UserToken & “#Email#|” /> 
<cfset UserToken = UserToken & “#DateFormat(now(), 
“yyyymmdd”)# #TimeFormat(now(), “HH:mm:ss”)#” /> 
<cfset EncryptedUserToken = Encrypt(UserToken, 
encryptionKey, “AES”, “Hex”) /> 
Use the Key 
<cfset DecryptedUserTokenList = 
Decrypt(EncryptedUserToken, encryptionKey, “AES”, 
“Hex”) />
Avoiding Server Shared Scopes
Stupid Developer Tricks 
● Looped Queries 
● Lazy-Man Pagination 
● ScheduledTask-o-rama 
● Database Abuse
Problem: Query in Loop 
<cfloop query="OldLastLogins"> 
<cfquery name="UpdateUsers" datasource="#datasource#"> 
UPDATE Users 
SET Active = 0 
WHERE UserID = #OldLastLogins.UserID# 
</cfquery> 
</cfloop>
Solution?: SQL IN Statement 
<cfquery name="UpdateUsers" datasource="#datasource#"> 
UPDATE Users 
SET Active = 0 
WHERE UserID IN #ValueList(OldLastLogins, UserID)# 
</cfquery>
Solution: Joins 
<cfquery name="UpdateUsers" datasource="#datasource#"> 
UPDATE users 
INNER JOIN lastlogin ON users.userID = lastlogin.userID 
SET Active = 0 
WHERE lastlogin < now() 
</cfquery>
Problem: EntityToQuery 
<cfscript> 
EntityToQuery( 
EntityLoad("Users", 
{ Gender =arguments.genderID} 
) 
); 
</cfscript>
Ouch, It hurts when I do that!
Get Poll Answers 
<cfset PollAnswers = entityLoad("PollAnswers", 
{ 
PollID=entPoll[1].getPollID() 
}, "")> 
<cfif (isArray(Poll) AND arrayLen(Poll) gt 0) 
AND (isArray(PollOpt) 
AND arrayLen(PollOpt) gt 0) 
AND (isArray(PollAnswers) 
AND arrayLen(PollAnswers) gt 0)>
Poll Net Result 
JDBC 
Recordcount: 87,923 
Query Time: 14,290 ms 
All that for an 
ArrayLen() GT 0!
Bad or No Indexing
Effect of adding 1 Index to Production
What is the number one 
cause of missing indexes in 
production?
Cross Joining for Fun and Profit 
INSERT INTO activity ( memberID, ActivityTypeID, ActivityDate, 
UnitOfMeasure, MetricValue, Description) 
( 
SELECT m.memberID, a.ActivityTypeID, 
Date_Add( '2014-12-31', INTERVAL -mod( RAND(3)*300, 300) DAY), 
UnitOfMeasure, MetricValue, Description 
FROM member m, activity a 
WHERE a.elapsedtime IS NOT NULL 
AND a.description IS NOT NULL 
AND mod( mod(m.memberid, 2), mod( a.activityid, 5) ) = 1 
AND m.communityid = 1 
)
Problem: Lazy Man Pagination 
<cfoutput query="GetParks" 
startrow="#StartRow#" 
maxrows="#MaxRows#"> 
#ParkName# 
</cfoutput>
Solution: SQL 
MySql, PostgreSQL: LIMIT, OFFSET 
SQL Server: TOP, ORDER BY 
ORACLE: WHERE rownum <= 10
Problem: No Encapsulation 
<cfif qExists.idexists> 
<cfquery name="qUpdate" datasource="#somedatasource#"> 
UPDATE tblKalendarCategories 
SET CategoryName = '#form.CategoryName#', 
CategoryTextColor = '#form.CategoryTextColor#' 
WHERE CategoryID = #form.CategoryID#' /> 
</cfquery> 
<cfelse> 
<cfquery name="qCreate" datasource="#somedatasource#"> 
INSERT INTO tblKalendarCategories 
( CategoryName, CategoryBGColor, CategoryTextColor ) 
VALUES 
( '#form.CategoryName#', '#form.CategoryTextColor#') 
</cfquery> 
</cfif>
Solution: Encapsulate Data Access 
DAO.read(); 
DAO.save(); 
DAO.delete(); 
DAO.create(); 
DAO.exists(); 
DAO.update();
Cacheability
Caching Layers
Caching HTTP Responses 
Request: 
GET /index.html HTTP/1.1 
Host: www.example.com 
Response: 
HTTP/1.1 200 OK 
Date: Mon, 23 May 2005 22:38:34 GMT 
Server: Apache/1.3.3.7 (Unix) (Red- 
Hat/Linux) 
Last-Modified: Wed, 08 Jan 2003 
23:11:55 GMT 
ETag: "3f80f-1b6-3e1cb03b" 
Content-Type: text/html; charset=UTF-8 
Content-Length: 131 
Accept-Ranges: bytes 
Connection: close
Caching HTTP Responses
Designing for a CDN or Reverse 
Proxy Cache 
● Use HTTP verb “GET” for cacheable content 
● Use Last-Modified and Etag headers properly 
● Encapsulate code that changes content to 
centralize cache purge activity 
● Personalize with Cookies/Javascript 
● Set up shadow DNS to bypass caching 
● Use Javascript for interactions 
● Design data for high cache hit ratios
Caching Data
NoSQL as a Cache 
{ 
"_id" : ObjectId("51fff472e09a41ac19dd1876"), 
"NAME" : "Dan", 
"KIDS" : [ 
{ 
"NAME" : "Nick", 
"AGE" : 3.5, 
"DESCRIPTION" : "crazy", 
"HAIR" : "blonde" 
}, 
{ 
"NAME" : "Jack", 
"AGE" : 1.75 
} 
] 
}
NoSql Cache Diagram
Designing for a NoSQL Cache 
● Encapsulate calls to NoSQL engine 
● Encapsulate data publish methods 
● Design Content Purge algorithms well 
● Ensure the NoSQL engine is the authoritative 
source for the data being stored
Key/Value stores
Key Value Store Cache Diagram
Designing for a Key Value Store 
Cache 
● Encapsulate data access calls so you can 
purge/reload 
● Avoid cffunction output=”true” 
● Choose correct cache expiry strategy (time, 
LRU) 
● Easy to integrate with CF ORM 
● Use to remove load hotspoting
<cfcomponent> 
<cffunction name="loadProduct" returntype="Product" access="public"> 
<cfargument name="ProductID" type="numeric" required="true"/> 
<cfset var CacheKey = makeProductCacheKey(arguments.ProductID)/> 
<cfif variables.Cache.exists(CacheKey) IS false> 
<cflock name="#CacheKey#" timeout="10"> 
<cfif variables.Cache.exists(CacheKey) IS false> 
<cfset variables.Cache.put(CacheKey, 
variables.ProductService.get(arguments.ProductID))/> 
</cfif> 
</cflock> 
</cfif> 
<cfreturn variables.Cache.get(CacheKey)/> 
</cffunction> 
<cffunction name="saveProduct" returntype="Product" access="public"> 
<cfargument name="ProductID" type="numeric" required="true"/> 
<cfargument name="Name" type="text" required="true"/> 
<cfset var CacheKey = makeProductCacheKey(arguments.ProductID)/> 
<cfset var Product = variables.ProductService.get(arguments.ProductID)/> 
<cfset Product.setName(arguments.Name)/> 
<cfset Product = variables.ProductService.save(Product)/> 
<cfset variables.Cache.set(CacheKey, Product)/> 
<cfreturn variables.Cache.get(CacheKey)/> 
</cffunction> 
<cffunction name="makeProductCacheKey" returntype="string" access="private"> 
<cfargument name="ProductID" type="numeric" required="true"/> 
<cfreturn "Product_#val(arguments.ProductID)#"/> 
</cffunction> 
</cfcomponent>
Alternate Cache Methods
Time is Money
Thanks 
Dan Wilson 
nodans.com 
twitter.com/DanWilson 
www.linkedin.com/in/profile 
ofdanwilson
Appendix and helpful links
A Note for MySQL users 
[mysqld] 
innodb_file_per_table 
1. Do a mysqldump of all databases, procedures, triggers etc 
except the mysql and performance_schema databases 
2. Drop all databases except the above 2 databases 
3. Stop mysql 
4. Delete ibdata1 and ib_log files 
5. Start mysql 
6. Restore from dump
Content Delivery Network 
PROS 
● Caches HTTP Response 
● Ajax Friendly 
● Static Content 
● TTL/Manual Purge 
● Blazing Fast 
● Can be geographically 
distributed 
● No physical infrastructure to 
manage 
● Pay for what you use 
CONS 
● Pay for what you use 
● SSL is more complicated 
● Testing is more complicated 
● Reliant on external service 
● Not a good fit for intranet 
traffic
Content Delivery Options 
www.akamai.com 
aws.amazon.com/cloudfront
Monitoring Options 
ColdFusion Server 
Monitor 
CFStat 
New Relic – SaaS 
Fusion Reactor Monitor 
Nagios
Reverse Proxy Cache (Front Cache)
Reverse Proxy Cache 
PROS 
● Caches HTTP Response 
● Ajax Friendly 
● Static Content 
● TTL/Manual Purge 
● Blazing Fast 
● Many Open Source 
Products 
● Low operating expense 
● Can be used for intranets 
CONS 
● Personalization must be 
client side (no session 
scope) 
● Content is treated as static 
● Testing is more complicated 
● Must Manage Physical 
Infrastructure 
● Often Geographically 
Localized
Key Value Store 
PROS 
● Blazing Fast 
● Can cache any in-memory 
item 
● Some caches are 
sophisticated, some 
aren't 
● Can be distributed 
● Simple interfaces 
● Integrated in CF 
CONS 
● Many Cached Items 
represent an HTTP 
request 
● What is real-time to your 
application? 
● Key management can 
be hard 
● WYCIWYG (what you 
cache is what you get)
Helpful Links 
In-Memory Cache 
Reverse Proxy 
http://www.ehcache.org 
Cache 
http://terracotta.org/coldfusio 
http://varnish-cache.org 
n 
Tutorials on Caching 
http://Scalability www.squid-cache.org 
http://memcached.org 
Blogs 
http://trafficserver.apache.org Varnish: http://bit.ly/c1puD6 
http://cfwhisperer.com 
Squid Video: http://bit.ly/9iZu1Z 
http://highscalability.com 
Aaron West: http://bit.ly/a4sYcr 
Rob Brooks-Bilson: http://bit.ly/txser 
Terracotta Webinar: http://www.terracotta.org/webcasts 
This presentation: http://tinyurl.com/cacheme

More Related Content

What's hot

VCL template abstraction model and automated deployments to Fastly
VCL template abstraction model and automated deployments to FastlyVCL template abstraction model and automated deployments to Fastly
VCL template abstraction model and automated deployments to FastlyFastly
 
Advanced VCL: how to use restart
Advanced VCL: how to use restartAdvanced VCL: how to use restart
Advanced VCL: how to use restartFastly
 
Java. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax ApplicationsJava. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax ApplicationsМарія Русин
 
UA testing with Selenium and PHPUnit - PHPBenelux Summer BBQ
UA testing with Selenium and PHPUnit - PHPBenelux Summer BBQUA testing with Selenium and PHPUnit - PHPBenelux Summer BBQ
UA testing with Selenium and PHPUnit - PHPBenelux Summer BBQMichelangelo van Dam
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeWim Godden
 
JDD2014: What you won't read in books about implementing REST services - Jak...
JDD2014:  What you won't read in books about implementing REST services - Jak...JDD2014:  What you won't read in books about implementing REST services - Jak...
JDD2014: What you won't read in books about implementing REST services - Jak...PROIDEA
 
Apache Commons Pool and DBCP - Version 2 Update
Apache Commons Pool and DBCP - Version 2 UpdateApache Commons Pool and DBCP - Version 2 Update
Apache Commons Pool and DBCP - Version 2 UpdatePhil Steitz
 
Android httpclient
Android httpclientAndroid httpclient
Android httpclientallanh0526
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communicationsWO Community
 
Bpug mcollective 20140624
Bpug mcollective 20140624Bpug mcollective 20140624
Bpug mcollective 20140624Johan De Wit
 
React, Redux and es6/7
React, Redux and es6/7React, Redux and es6/7
React, Redux and es6/7Dongho Cho
 
A Groovy Kind of Java (San Francisco Java User Group)
A Groovy Kind of Java (San Francisco Java User Group)A Groovy Kind of Java (San Francisco Java User Group)
A Groovy Kind of Java (San Francisco Java User Group)Nati Shalom
 
Let ColdFusion ORM do the work for you!
Let ColdFusion ORM do the work for you!Let ColdFusion ORM do the work for you!
Let ColdFusion ORM do the work for you!Masha Edelen
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I thinkWim Godden
 
$.get, a Prime on Data Fetching
$.get, a Prime on Data Fetching$.get, a Prime on Data Fetching
$.get, a Prime on Data FetchingJosh Black
 
Power of Simplicity in FW/1
Power of Simplicity in FW/1Power of Simplicity in FW/1
Power of Simplicity in FW/1Masha Edelen
 
Varnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user groupVarnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user groupJorge Nerín
 
HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?Remy Sharp
 
Geoserver GIS Mapping Solution
Geoserver GIS Mapping SolutionGeoserver GIS Mapping Solution
Geoserver GIS Mapping SolutionKeshavSharma274
 

What's hot (20)

VCL template abstraction model and automated deployments to Fastly
VCL template abstraction model and automated deployments to FastlyVCL template abstraction model and automated deployments to Fastly
VCL template abstraction model and automated deployments to Fastly
 
Advanced VCL: how to use restart
Advanced VCL: how to use restartAdvanced VCL: how to use restart
Advanced VCL: how to use restart
 
Java. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax ApplicationsJava. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax Applications
 
UA testing with Selenium and PHPUnit - PHPBenelux Summer BBQ
UA testing with Selenium and PHPUnit - PHPBenelux Summer BBQUA testing with Selenium and PHPUnit - PHPBenelux Summer BBQ
UA testing with Selenium and PHPUnit - PHPBenelux Summer BBQ
 
Beyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the codeBeyond PHP - it's not (just) about the code
Beyond PHP - it's not (just) about the code
 
JDD2014: What you won't read in books about implementing REST services - Jak...
JDD2014:  What you won't read in books about implementing REST services - Jak...JDD2014:  What you won't read in books about implementing REST services - Jak...
JDD2014: What you won't read in books about implementing REST services - Jak...
 
Apache Commons Pool and DBCP - Version 2 Update
Apache Commons Pool and DBCP - Version 2 UpdateApache Commons Pool and DBCP - Version 2 Update
Apache Commons Pool and DBCP - Version 2 Update
 
Android httpclient
Android httpclientAndroid httpclient
Android httpclient
 
Security and performance designs for client-server communications
Security and performance designs for client-server communicationsSecurity and performance designs for client-server communications
Security and performance designs for client-server communications
 
Bpug mcollective 20140624
Bpug mcollective 20140624Bpug mcollective 20140624
Bpug mcollective 20140624
 
React, Redux and es6/7
React, Redux and es6/7React, Redux and es6/7
React, Redux and es6/7
 
A Groovy Kind of Java (San Francisco Java User Group)
A Groovy Kind of Java (San Francisco Java User Group)A Groovy Kind of Java (San Francisco Java User Group)
A Groovy Kind of Java (San Francisco Java User Group)
 
Let ColdFusion ORM do the work for you!
Let ColdFusion ORM do the work for you!Let ColdFusion ORM do the work for you!
Let ColdFusion ORM do the work for you!
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
$.get, a Prime on Data Fetching
$.get, a Prime on Data Fetching$.get, a Prime on Data Fetching
$.get, a Prime on Data Fetching
 
Power of Simplicity in FW/1
Power of Simplicity in FW/1Power of Simplicity in FW/1
Power of Simplicity in FW/1
 
Varnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user groupVarnish presentation for the Symfony Zaragoza user group
Varnish presentation for the Symfony Zaragoza user group
 
HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?HTML5: friend or foe (to Flash)?
HTML5: friend or foe (to Flash)?
 
Mule caching strategy with redis cache
Mule caching strategy with redis cacheMule caching strategy with redis cache
Mule caching strategy with redis cache
 
Geoserver GIS Mapping Solution
Geoserver GIS Mapping SolutionGeoserver GIS Mapping Solution
Geoserver GIS Mapping Solution
 

Viewers also liked

Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server DatabasesColdFusionConference
 
Hey my web app is slow where is the problem
Hey my web app is slow where is the problemHey my web app is slow where is the problem
Hey my web app is slow where is the problemColdFusionConference
 
Dev objecttives-2015 auth-auth-fine-grained-slides
Dev objecttives-2015 auth-auth-fine-grained-slidesDev objecttives-2015 auth-auth-fine-grained-slides
Dev objecttives-2015 auth-auth-fine-grained-slidesColdFusionConference
 
Expand Your ColdFusion App Power with AWS
Expand Your ColdFusion App Power with AWSExpand Your ColdFusion App Power with AWS
Expand Your ColdFusion App Power with AWSColdFusionConference
 
Accessible Video Anywhere with ColdFusion an AWS
Accessible Video Anywhere with ColdFusion an AWSAccessible Video Anywhere with ColdFusion an AWS
Accessible Video Anywhere with ColdFusion an AWSColdFusionConference
 
Adaptive Development in a Creative World
Adaptive Development in a Creative WorldAdaptive Development in a Creative World
Adaptive Development in a Creative WorldColdFusionConference
 
Cf objective2014 software-craftsmanship
Cf objective2014 software-craftsmanshipCf objective2014 software-craftsmanship
Cf objective2014 software-craftsmanshipColdFusionConference
 
Emberjs building-ambitious-web-applications
Emberjs building-ambitious-web-applicationsEmberjs building-ambitious-web-applications
Emberjs building-ambitious-web-applicationsColdFusionConference
 
Single page apps_with_cf_and_angular[1]
Single page apps_with_cf_and_angular[1]Single page apps_with_cf_and_angular[1]
Single page apps_with_cf_and_angular[1]ColdFusionConference
 
Getting started with mobile application development
Getting started with mobile application developmentGetting started with mobile application development
Getting started with mobile application developmentColdFusionConference
 

Viewers also liked (20)

Mura intergration-slides
Mura intergration-slidesMura intergration-slides
Mura intergration-slides
 
Keep Applications Online
Keep Applications OnlineKeep Applications Online
Keep Applications Online
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
 
Building better SQL Server Databases
Building better SQL Server DatabasesBuilding better SQL Server Databases
Building better SQL Server Databases
 
Hey my web app is slow where is the problem
Hey my web app is slow where is the problemHey my web app is slow where is the problem
Hey my web app is slow where is the problem
 
Dev objecttives-2015 auth-auth-fine-grained-slides
Dev objecttives-2015 auth-auth-fine-grained-slidesDev objecttives-2015 auth-auth-fine-grained-slides
Dev objecttives-2015 auth-auth-fine-grained-slides
 
ColdFusion in Transit action
ColdFusion in Transit actionColdFusion in Transit action
ColdFusion in Transit action
 
Fr sponsor talk may 2015
Fr sponsor talk may 2015Fr sponsor talk may 2015
Fr sponsor talk may 2015
 
API Management from the Trenches
API Management from the TrenchesAPI Management from the Trenches
API Management from the Trenches
 
Expand Your ColdFusion App Power with AWS
Expand Your ColdFusion App Power with AWSExpand Your ColdFusion App Power with AWS
Expand Your ColdFusion App Power with AWS
 
Preso slidedeck
Preso slidedeckPreso slidedeck
Preso slidedeck
 
Accessible Video Anywhere with ColdFusion an AWS
Accessible Video Anywhere with ColdFusion an AWSAccessible Video Anywhere with ColdFusion an AWS
Accessible Video Anywhere with ColdFusion an AWS
 
Relationships are hard
Relationships are hardRelationships are hard
Relationships are hard
 
Adaptive Development in a Creative World
Adaptive Development in a Creative WorldAdaptive Development in a Creative World
Adaptive Development in a Creative World
 
Java scriptconfusingbits
Java scriptconfusingbitsJava scriptconfusingbits
Java scriptconfusingbits
 
Cf objective2014 software-craftsmanship
Cf objective2014 software-craftsmanshipCf objective2014 software-craftsmanship
Cf objective2014 software-craftsmanship
 
Emberjs building-ambitious-web-applications
Emberjs building-ambitious-web-applicationsEmberjs building-ambitious-web-applications
Emberjs building-ambitious-web-applications
 
Dependency injectionpreso
Dependency injectionpresoDependency injectionpreso
Dependency injectionpreso
 
Single page apps_with_cf_and_angular[1]
Single page apps_with_cf_and_angular[1]Single page apps_with_cf_and_angular[1]
Single page apps_with_cf_and_angular[1]
 
Getting started with mobile application development
Getting started with mobile application developmentGetting started with mobile application development
Getting started with mobile application development
 

Similar to Top5 scalabilityissues

Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsBen Hall
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricWim Van den Broeck
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
Caching & Performance In Cold Fusion
Caching & Performance In Cold FusionCaching & Performance In Cold Fusion
Caching & Performance In Cold FusionDenard Springle IV
 
Language enhancement in ColdFusion 8
Language enhancement in ColdFusion 8Language enhancement in ColdFusion 8
Language enhancement in ColdFusion 8Rupesh Kumar
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenchesLukas Smith
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Web Directions
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesDoris Chen
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaksColdFusionConference
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaksdevObjective
 
Presentation of OrientDB v2.2 - Webinar
Presentation of OrientDB v2.2 - WebinarPresentation of OrientDB v2.2 - Webinar
Presentation of OrientDB v2.2 - WebinarOrient Technologies
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortalJennifer Bourey
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Hugo Hamon
 
Clug 2011 March web server optimisation
Clug 2011 March  web server optimisationClug 2011 March  web server optimisation
Clug 2011 March web server optimisationgrooverdan
 

Similar to Top5 scalabilityissues (20)

Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Coldfusion with Keith Diehl
Coldfusion with Keith DiehlColdfusion with Keith Diehl
Coldfusion with Keith Diehl
 
Scale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabricScale Your Data Tier with Windows Server AppFabric
Scale Your Data Tier with Windows Server AppFabric
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
Caching & Performance In Cold Fusion
Caching & Performance In Cold FusionCaching & Performance In Cold Fusion
Caching & Performance In Cold Fusion
 
Language enhancement in ColdFusion 8
Language enhancement in ColdFusion 8Language enhancement in ColdFusion 8
Language enhancement in ColdFusion 8
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Refreshing mule cache using oracle database change notification
Refreshing mule cache using oracle database change notificationRefreshing mule cache using oracle database change notification
Refreshing mule cache using oracle database change notification
 
Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5Dave Orchard - Offline Web Apps with HTML5
Dave Orchard - Offline Web Apps with HTML5
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 
Cache is King
Cache is KingCache is King
Cache is King
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
Our application got popular and now it breaks
Our application got popular and now it breaksOur application got popular and now it breaks
Our application got popular and now it breaks
 
Presentation of OrientDB v2.2 - Webinar
Presentation of OrientDB v2.2 - WebinarPresentation of OrientDB v2.2 - Webinar
Presentation of OrientDB v2.2 - Webinar
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
 
Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2Build powerfull and smart web applications with Symfony2
Build powerfull and smart web applications with Symfony2
 
Cookies
CookiesCookies
Cookies
 
Into The Box 2018 Ortus Keynote
Into The Box 2018 Ortus KeynoteInto The Box 2018 Ortus Keynote
Into The Box 2018 Ortus Keynote
 
Clug 2011 March web server optimisation
Clug 2011 March  web server optimisationClug 2011 March  web server optimisation
Clug 2011 March web server optimisation
 

More from ColdFusionConference

API Economy, Realizing the Business Value of APIs
API Economy, Realizing the Business Value of APIsAPI Economy, Realizing the Business Value of APIs
API Economy, Realizing the Business Value of APIsColdFusionConference
 
Crafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an ArchitectCrafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an ArchitectColdFusionConference
 
Security And Access Control For APIS using CF API Manager
Security And Access Control For APIS using CF API ManagerSecurity And Access Control For APIS using CF API Manager
Security And Access Control For APIS using CF API ManagerColdFusionConference
 
Monetizing Business Models: ColdFusion and APIS
Monetizing Business Models: ColdFusion and APISMonetizing Business Models: ColdFusion and APIS
Monetizing Business Models: ColdFusion and APISColdFusionConference
 
Become a Security Rockstar with ColdFusion 2016
Become a Security Rockstar with ColdFusion 2016Become a Security Rockstar with ColdFusion 2016
Become a Security Rockstar with ColdFusion 2016ColdFusionConference
 
Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016ColdFusionConference
 
ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusion Keynote: Building the Agile Web Since 1995ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusion Keynote: Building the Agile Web Since 1995ColdFusionConference
 
Super Fast Application development with Mura CMS
Super Fast Application development with Mura CMSSuper Fast Application development with Mura CMS
Super Fast Application development with Mura CMSColdFusionConference
 
Build your own secure and real-time dashboard for mobile and web
Build your own secure and real-time dashboard for mobile and webBuild your own secure and real-time dashboard for mobile and web
Build your own secure and real-time dashboard for mobile and webColdFusionConference
 
Herding cats managing ColdFusion servers with commandbox
Herding cats managing ColdFusion servers with commandboxHerding cats managing ColdFusion servers with commandbox
Herding cats managing ColdFusion servers with commandboxColdFusionConference
 

More from ColdFusionConference (20)

Api manager preconference
Api manager preconferenceApi manager preconference
Api manager preconference
 
Cf ppt vsr
Cf ppt vsrCf ppt vsr
Cf ppt vsr
 
API Economy, Realizing the Business Value of APIs
API Economy, Realizing the Business Value of APIsAPI Economy, Realizing the Business Value of APIs
API Economy, Realizing the Business Value of APIs
 
Don't just pdf, Smart PDF
Don't just pdf, Smart PDFDon't just pdf, Smart PDF
Don't just pdf, Smart PDF
 
Crafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an ArchitectCrafting ColdFusion Applications like an Architect
Crafting ColdFusion Applications like an Architect
 
Security And Access Control For APIS using CF API Manager
Security And Access Control For APIS using CF API ManagerSecurity And Access Control For APIS using CF API Manager
Security And Access Control For APIS using CF API Manager
 
Monetizing Business Models: ColdFusion and APIS
Monetizing Business Models: ColdFusion and APISMonetizing Business Models: ColdFusion and APIS
Monetizing Business Models: ColdFusion and APIS
 
Become a Security Rockstar with ColdFusion 2016
Become a Security Rockstar with ColdFusion 2016Become a Security Rockstar with ColdFusion 2016
Become a Security Rockstar with ColdFusion 2016
 
Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016Developer Insights for Application Upgrade to ColdFusion 2016
Developer Insights for Application Upgrade to ColdFusion 2016
 
Where is cold fusion headed
Where is cold fusion headedWhere is cold fusion headed
Where is cold fusion headed
 
ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusion Keynote: Building the Agile Web Since 1995ColdFusion Keynote: Building the Agile Web Since 1995
ColdFusion Keynote: Building the Agile Web Since 1995
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
 
Restful services with ColdFusion
Restful services with ColdFusionRestful services with ColdFusion
Restful services with ColdFusion
 
Super Fast Application development with Mura CMS
Super Fast Application development with Mura CMSSuper Fast Application development with Mura CMS
Super Fast Application development with Mura CMS
 
Build your own secure and real-time dashboard for mobile and web
Build your own secure and real-time dashboard for mobile and webBuild your own secure and real-time dashboard for mobile and web
Build your own secure and real-time dashboard for mobile and web
 
Why Everyone else writes bad code
Why Everyone else writes bad codeWhy Everyone else writes bad code
Why Everyone else writes bad code
 
Securing applications
Securing applicationsSecuring applications
Securing applications
 
Testing automaton
Testing automatonTesting automaton
Testing automaton
 
Rest ful tools for lazy experts
Rest ful tools for lazy expertsRest ful tools for lazy experts
Rest ful tools for lazy experts
 
Herding cats managing ColdFusion servers with commandbox
Herding cats managing ColdFusion servers with commandboxHerding cats managing ColdFusion servers with commandbox
Herding cats managing ColdFusion servers with commandbox
 

Recently uploaded

VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 

Recently uploaded (20)

VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024VictoriaMetrics Anomaly Detection Updates: Q1 2024
VictoriaMetrics Anomaly Detection Updates: Q1 2024
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 

Top5 scalabilityissues

  • 1. The Top 5 Things You are doing today to hinder scalability Dan Wilson
  • 2. Who is Dan Wilson  Runs ChallengeWave.com, Datacurl LLC and NCDevCon  Owner of Model-Glue  Dad of 2, Husband to 1  Loves all things technical and a good debate Gives bad stock tips
  • 3.
  • 4. Our Top 5 List 1.Monolithic Design 2.Mis-identification/Misuse of shared resources 3.Over-reliance on Shared Scopes 4.Stupid Developer Tricks 5.Failure to design for cacheability
  • 5. Monolithic Design Credit: http://thecodelesscode.com/case/33
  • 8.
  • 12. Cost of WebServer File Web Server Thread + Network to File System + Disk Wait Time + Disk Seek Time + Transfer time to Webserver + Transfer time to complete HTTP Request ______________________ Total Time
  • 13. Cost of 1 ColdFusion File Web Server Cost + Network Cost to CF Server + CF Parsing or Classloading Time + Thread Wait time + Thread CPU time + Transfer time for CF buffer to Webserver ______________________ Total Time
  • 14. Cost of ColdFusion File With Query Web Server Cost + ColdFusion File Cost + Number of Queries ( Network time to DB + Query Execution Plan + Query Execution + Disk Wait + Disk Seek ) + Network time to transport result set to CF + CF Parsing Time ______________________ Total Time
  • 15. Types of Shared Resources ● Memory, CPU, Disk Space ● Disk Transfer (Databases!!) ● JVM Space ● ColdFusion template cache ● ColdFusion Threads ● Network Traffic ● Database/Data Store ● Blah ● Blah ● Blah
  • 17. Over-reliance on Shared Scopes ● Session Scope use is the largest culprit ● Sometimes you have to deoptimize a few operations in order to provide a scalable solution (like stop caching a state query in application scope) ● If you want to use a shared scope and want to keep an eye on scalability later, use a lookup factory.
  • 18. But, what about sticky sessions?
  • 20. <cfcomponent> <cfset variables.instance = structNew() /> <cffunction name="init" returntype="CurrentUserLoader" output="false" access="public"> <cfargument name="UserService" type="any" required="true"/> <cfset variables.UserService = arguments.UserService /> <cfreturn this /> </cffunction> <cffunction name="destroy" output="false" access="public" returntype="void" > <cfset cookie.UserToken = "" /> <cfset structDelete( cookie, "UserToken") /> </cffunction> <cffunction name="load" output="false" access="public" returntype="any" hint=""> <cfset var loggedInUserToken = "" /> <cfif structkeyExists(cookie, "UserToken")> <cfset loggedInUserToken = cookie.UserToken /> </cfif> <cfreturn variables.UserService.loadUserByToken("User", loggedInUserToken ) /> </cffunction> <cffunction name="set" output="false" access="public" returntype="void" hint=""> <cfargument name="user" type="any" required="true"/> <cfset cookie.UserToken = arguments.User.getUserToken() /> </cffunction> </cfcomponent>
  • 21. Make the Key <cfset UserToken = “#UserID#|” /> <cfset UserToken = UserToken & “MySharedSecret|” /> <cfset UserToken = UserToken & “#Email#|” /> <cfset UserToken = UserToken & “#DateFormat(now(), “yyyymmdd”)# #TimeFormat(now(), “HH:mm:ss”)#” /> <cfset EncryptedUserToken = Encrypt(UserToken, encryptionKey, “AES”, “Hex”) /> Use the Key <cfset DecryptedUserTokenList = Decrypt(EncryptedUserToken, encryptionKey, “AES”, “Hex”) />
  • 23. Stupid Developer Tricks ● Looped Queries ● Lazy-Man Pagination ● ScheduledTask-o-rama ● Database Abuse
  • 24. Problem: Query in Loop <cfloop query="OldLastLogins"> <cfquery name="UpdateUsers" datasource="#datasource#"> UPDATE Users SET Active = 0 WHERE UserID = #OldLastLogins.UserID# </cfquery> </cfloop>
  • 25. Solution?: SQL IN Statement <cfquery name="UpdateUsers" datasource="#datasource#"> UPDATE Users SET Active = 0 WHERE UserID IN #ValueList(OldLastLogins, UserID)# </cfquery>
  • 26.
  • 27. Solution: Joins <cfquery name="UpdateUsers" datasource="#datasource#"> UPDATE users INNER JOIN lastlogin ON users.userID = lastlogin.userID SET Active = 0 WHERE lastlogin < now() </cfquery>
  • 28. Problem: EntityToQuery <cfscript> EntityToQuery( EntityLoad("Users", { Gender =arguments.genderID} ) ); </cfscript>
  • 29. Ouch, It hurts when I do that!
  • 30.
  • 31. Get Poll Answers <cfset PollAnswers = entityLoad("PollAnswers", { PollID=entPoll[1].getPollID() }, "")> <cfif (isArray(Poll) AND arrayLen(Poll) gt 0) AND (isArray(PollOpt) AND arrayLen(PollOpt) gt 0) AND (isArray(PollAnswers) AND arrayLen(PollAnswers) gt 0)>
  • 32. Poll Net Result JDBC Recordcount: 87,923 Query Time: 14,290 ms All that for an ArrayLen() GT 0!
  • 33. Bad or No Indexing
  • 34. Effect of adding 1 Index to Production
  • 35. What is the number one cause of missing indexes in production?
  • 36. Cross Joining for Fun and Profit INSERT INTO activity ( memberID, ActivityTypeID, ActivityDate, UnitOfMeasure, MetricValue, Description) ( SELECT m.memberID, a.ActivityTypeID, Date_Add( '2014-12-31', INTERVAL -mod( RAND(3)*300, 300) DAY), UnitOfMeasure, MetricValue, Description FROM member m, activity a WHERE a.elapsedtime IS NOT NULL AND a.description IS NOT NULL AND mod( mod(m.memberid, 2), mod( a.activityid, 5) ) = 1 AND m.communityid = 1 )
  • 37. Problem: Lazy Man Pagination <cfoutput query="GetParks" startrow="#StartRow#" maxrows="#MaxRows#"> #ParkName# </cfoutput>
  • 38. Solution: SQL MySql, PostgreSQL: LIMIT, OFFSET SQL Server: TOP, ORDER BY ORACLE: WHERE rownum <= 10
  • 39. Problem: No Encapsulation <cfif qExists.idexists> <cfquery name="qUpdate" datasource="#somedatasource#"> UPDATE tblKalendarCategories SET CategoryName = '#form.CategoryName#', CategoryTextColor = '#form.CategoryTextColor#' WHERE CategoryID = #form.CategoryID#' /> </cfquery> <cfelse> <cfquery name="qCreate" datasource="#somedatasource#"> INSERT INTO tblKalendarCategories ( CategoryName, CategoryBGColor, CategoryTextColor ) VALUES ( '#form.CategoryName#', '#form.CategoryTextColor#') </cfquery> </cfif>
  • 40. Solution: Encapsulate Data Access DAO.read(); DAO.save(); DAO.delete(); DAO.create(); DAO.exists(); DAO.update();
  • 43. Caching HTTP Responses Request: GET /index.html HTTP/1.1 Host: www.example.com Response: HTTP/1.1 200 OK Date: Mon, 23 May 2005 22:38:34 GMT Server: Apache/1.3.3.7 (Unix) (Red- Hat/Linux) Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT ETag: "3f80f-1b6-3e1cb03b" Content-Type: text/html; charset=UTF-8 Content-Length: 131 Accept-Ranges: bytes Connection: close
  • 45. Designing for a CDN or Reverse Proxy Cache ● Use HTTP verb “GET” for cacheable content ● Use Last-Modified and Etag headers properly ● Encapsulate code that changes content to centralize cache purge activity ● Personalize with Cookies/Javascript ● Set up shadow DNS to bypass caching ● Use Javascript for interactions ● Design data for high cache hit ratios
  • 47. NoSQL as a Cache { "_id" : ObjectId("51fff472e09a41ac19dd1876"), "NAME" : "Dan", "KIDS" : [ { "NAME" : "Nick", "AGE" : 3.5, "DESCRIPTION" : "crazy", "HAIR" : "blonde" }, { "NAME" : "Jack", "AGE" : 1.75 } ] }
  • 49. Designing for a NoSQL Cache ● Encapsulate calls to NoSQL engine ● Encapsulate data publish methods ● Design Content Purge algorithms well ● Ensure the NoSQL engine is the authoritative source for the data being stored
  • 51. Key Value Store Cache Diagram
  • 52. Designing for a Key Value Store Cache ● Encapsulate data access calls so you can purge/reload ● Avoid cffunction output=”true” ● Choose correct cache expiry strategy (time, LRU) ● Easy to integrate with CF ORM ● Use to remove load hotspoting
  • 53. <cfcomponent> <cffunction name="loadProduct" returntype="Product" access="public"> <cfargument name="ProductID" type="numeric" required="true"/> <cfset var CacheKey = makeProductCacheKey(arguments.ProductID)/> <cfif variables.Cache.exists(CacheKey) IS false> <cflock name="#CacheKey#" timeout="10"> <cfif variables.Cache.exists(CacheKey) IS false> <cfset variables.Cache.put(CacheKey, variables.ProductService.get(arguments.ProductID))/> </cfif> </cflock> </cfif> <cfreturn variables.Cache.get(CacheKey)/> </cffunction> <cffunction name="saveProduct" returntype="Product" access="public"> <cfargument name="ProductID" type="numeric" required="true"/> <cfargument name="Name" type="text" required="true"/> <cfset var CacheKey = makeProductCacheKey(arguments.ProductID)/> <cfset var Product = variables.ProductService.get(arguments.ProductID)/> <cfset Product.setName(arguments.Name)/> <cfset Product = variables.ProductService.save(Product)/> <cfset variables.Cache.set(CacheKey, Product)/> <cfreturn variables.Cache.get(CacheKey)/> </cffunction> <cffunction name="makeProductCacheKey" returntype="string" access="private"> <cfargument name="ProductID" type="numeric" required="true"/> <cfreturn "Product_#val(arguments.ProductID)#"/> </cffunction> </cfcomponent>
  • 56. Thanks Dan Wilson nodans.com twitter.com/DanWilson www.linkedin.com/in/profile ofdanwilson
  • 58. A Note for MySQL users [mysqld] innodb_file_per_table 1. Do a mysqldump of all databases, procedures, triggers etc except the mysql and performance_schema databases 2. Drop all databases except the above 2 databases 3. Stop mysql 4. Delete ibdata1 and ib_log files 5. Start mysql 6. Restore from dump
  • 59. Content Delivery Network PROS ● Caches HTTP Response ● Ajax Friendly ● Static Content ● TTL/Manual Purge ● Blazing Fast ● Can be geographically distributed ● No physical infrastructure to manage ● Pay for what you use CONS ● Pay for what you use ● SSL is more complicated ● Testing is more complicated ● Reliant on external service ● Not a good fit for intranet traffic
  • 60. Content Delivery Options www.akamai.com aws.amazon.com/cloudfront
  • 61. Monitoring Options ColdFusion Server Monitor CFStat New Relic – SaaS Fusion Reactor Monitor Nagios
  • 62. Reverse Proxy Cache (Front Cache)
  • 63. Reverse Proxy Cache PROS ● Caches HTTP Response ● Ajax Friendly ● Static Content ● TTL/Manual Purge ● Blazing Fast ● Many Open Source Products ● Low operating expense ● Can be used for intranets CONS ● Personalization must be client side (no session scope) ● Content is treated as static ● Testing is more complicated ● Must Manage Physical Infrastructure ● Often Geographically Localized
  • 64. Key Value Store PROS ● Blazing Fast ● Can cache any in-memory item ● Some caches are sophisticated, some aren't ● Can be distributed ● Simple interfaces ● Integrated in CF CONS ● Many Cached Items represent an HTTP request ● What is real-time to your application? ● Key management can be hard ● WYCIWYG (what you cache is what you get)
  • 65. Helpful Links In-Memory Cache Reverse Proxy http://www.ehcache.org Cache http://terracotta.org/coldfusio http://varnish-cache.org n Tutorials on Caching http://Scalability www.squid-cache.org http://memcached.org Blogs http://trafficserver.apache.org Varnish: http://bit.ly/c1puD6 http://cfwhisperer.com Squid Video: http://bit.ly/9iZu1Z http://highscalability.com Aaron West: http://bit.ly/a4sYcr Rob Brooks-Bilson: http://bit.ly/txser Terracotta Webinar: http://www.terracotta.org/webcasts This presentation: http://tinyurl.com/cacheme