Scotch on the Rocks 2010, Day 2 part 2

Submitted by Falken on

cloudy with a chance of caching and clustering

Mark Drew
Mark is always a popular speaker, and he started his talk with questions around what happens when your web site gets popular quickly ? As an example he used the ubiquitous country list dropdown box. Does this really need to be a query ? Obviously not (countries hardly ever change !) but does it really need the next normal solution, and Application scoped cache (or cachedWithin CFQUERY) ? You could use CFCACHE to cache the whole HTML fragment.
On Railo's ColdFusion engine you can choose where to put these sort of caches i.e. using standard distributed caches like memchached and ehcache. Being distributed the load can now be shared across any number of dumb load balanced servers. You can even peek into it using the Railo Administrator. It's a pay-for add on though.

Mark went  on to explain that even small clusters are good because you can scale to any number later, as long as you solve the problems like session replication once.
Alternatively (or as well) you can split various actors in your application in to separate instances too. These can even be spooled up on schedule to do tasks like batch report processing. In a cloud-compute world, you only pay for the run time you use, and starting and stopping a whole server is really really fast.
In addition, it looks like Amazon now provide VPN-only connections to their cloud services, so you can only connect to them from your office LAN, which might be secure enough for you business.

Mark also talked about things like CloudFront which is a private Content Delivery Network backed by Amazon's S3 storage - and Adobe's and Railo's engines both have native support for file operations on S3...

One note of caution was sounded though; you should find a backup host for your services because even Amazon falls over sometimes.

Productive Work Environment / Practices

Peter Bell (Railo)
Dare I say it that this was the most well-attended talk of this years Scotch ? There were people literally camped on the floor to listen to Pete !
Peter started of by saying the were three import things "Do stuff right, do nothing and do the right stuff".
When talking about simple things you can do to make yourself more productive, Peter used the example of the familiar "file, open, browse" pattern. This is walking your computer not running it. Learn keyboard shortcuts for things like this. You can go further and investigate launchers and multiple item clipboards (apparently even though I'm not the only lonely Linux user there, even fewer people use multiple clipboards). Each individual use of these things saves a few seconds. But, Peter suggests, how much is that over the day ? The week ? The year ?

Peter also talked about writing scripts to automate common tasks for you. It might take 10 minutes 3 times a month by hand to do something, think how much you could save even if it takes a half day to write the script...

Pleasantly the above took a lot longer that it looks like on my write up. Peter than talked a bit about Pomodoro as a personal time management system. He suggested  the minimum period you can really try it for is a month.
All you need is a (doesn't have to be physical) timer and a todo list, and a few simple rules. These include that an interupted pom. doesnt count, and nothing takes longer than 7 poms (so you should break it down more).
While pom'ing you should add internal to you interuptions are a todo (thinks like 'I must remember to go back and look up...'). Shut off distractions like email and Skype notifications, or let people know you will be saying 'On a pom.; come back in 8 mins'.

Another good idea Peter talked about was quiet hours, 2 in the morning and 2 in the afternoon. This is handy because to load and dump context for a task can lose up to an hour !
During these periods you can use strategies like "Inform, neogaton, return" to make people leave you to it.

Getting something as simple as a real paper todo list can help; it feels good to achieve 12 things a day, and see them actually ticked off !

Peter also look at handy tools like the Selenium FireFox plugin (which was already popular in the audience) to create test scripts that humans can follow. You can then use Browsermob to run them in parallel to load test.

In one of the sessions I wasn't it it was announced that Railo is getting command line interface, so you can write scripts using  "#!/bin/railo" and automate tasks using the language you already know. This could be very powerful, if you're using that ColdFusion run time.

As a way to evaluate these ideas, Peter says using time tracking allows you to have (monthly) retrospectives; and answer questions like did new tool X save time?

As a final tip, Peter suggested asking why 5 times to get to the root of problems and fix them there. An example would be being 'constantly' interrupted to restart a service, because it's not monitored, because, because, because, because I didn't spend a few hours writing that script to manage it.

Advanced ORM

Terry Ryan (Adobe)
This was a great partner to the earlier 'SQL to HQL' session, as it skipped the basics and went straight for the hard stuff.
Terry was good at explaining everything, so here's just a small list of the cunning tricks he showed:
All database operations are only flushed at the end of the page (or if you explicitly flush using ormFlush() or turn it off in an Application setting). You should flush at the start of transactions, but this means entityLoad()'ed objects are now invalid inside the transaction block in Adobe ColdFusion 9, but it's fixed in 9.0.1.

Terry also says to beware many to many links that form loops. The server uses lazy fetching by default however.

There was a note of caution though, that a lot of this stuff like the ORM cache or lazy loading is only there if you need it, you should leave well alone to start with :-)

Sections