Wednesday, October 7, 2009

Afternoon Session 1: Caching in ASP.NET with Memcached

My last session of the conference. From some talks with Ted during the alliance project, Memcached may be a better solution for session synchronization between PHP and .NET. I'll only get to attend about 45 minutes (out of 75) for this talk because the airport shuttle is picking me up.

Afternoon Session 1: Caching in ASP.NET with Memcached
Jeffery McManus
Platform Associates

Used by Facebook, Yahoo, Flickr (so well-tested in terms of scalability)
Presenter sees himself as "The Johnny Appleseed of Open Source" at VSLive.
Decouples caching from platform/dev environment (key of course to using across PHP/.NET
Distributed cache = better scalability
Preallocates memory - nonfragmented, does not need to allocate/deallocate small bits in real time like .NET would
Everything stored in key value pairs (can get around by applying an MD5 hash to a key)
Can store an object -- just gets serialized
Lots of .NET libs...he recommends BEit.Memcached (on Google code)

Have to run, but some really good stuff we should be using for shared cache.

Morning Session 2: Odd Bedfellows - Making Sense of PHP on Windows with MySQL and SQL Server

Rarely is it quite so apropos to use the word "apropos" to describe something, but this session definitely fits our situation.

Morning Session 2: Odd Bedfellows - Making Sense of PHP on Windows with MySQL and SQL Server
Andrew Brust

PHP is popular, cheaper, easier than .NET. Runs on anything.
Argues that platforms like Drupal and Joomla are actually the biggest drivers.
Can coexist, though...works on IIS (esp IIS7 and PHP 5.3) and can work well w/ SQL Server. PHP 5.3 first version that is highly optimized for Windows, but not yet ready for SQL Server.
Want to have FastCGI on server (built in on IIS7, extension on 5 and 6).

Extensions are easy to add and use, although it's sorta that debate over whether or not the fact that you CAN get an extension makes up for the fact that you HAVE TO get an extension. I flip flop on this argument I know -- I love Firefox.

MySQL engines: MyISAM or InnoDB. MyISAM is faster but does not support transactions...flip flop for InnoDB
As expected, SQL drivers very similar to MySQL ones. Note that MS's MSSQL driver only works with PHP5 and on Windows.

OK, so this presentation was not really what I thought it was going to be. It was definitely more focused on showing the good parts about PHP rather than the challenges of running it alongside .NET or communication between the two. This is not a bad thing -- there's a lot good about PHP. I will say that I at least found out a little for myself -- stuff Milhko probably knew -- about the challenges and requirements for getting PHP up on Windows.

Morning Session 1: Windows Azure - A New Era of Cloud Computing

Missed some yesterday afternoon, but back with a vengeance! I don't know if Windows Azure is the way we would go, but I do want to find out a bit more about cloud computing in general. A lot of this is stuff I think many already know very well and I just want to keep up.

Morning Session 1: Windows Azure - A New Era of Cloud Computing
Aaron Skonnard
Pluralsight

Plans to focus on the business and financial benefits. Says developers won't like it.
Amazon (S3) still the leaders, MS catching up quickly.
Low total cost, "provision" servers quickly (in minutes!)
No necessity to over-provision to handle spikes
At Google, 1 admin may manage >1000 servers.
Azure is generally have to develop differently since platform is abstracted from the infrastructure (so can't do things like access file system in the same way) [Note: Really curious about the impacts here for us...]

Economies of Scale:
Medium data center: $95/Mbps/month, Storage $2.20/GB/month
Large data center: $13/Mbps/month, Storage $0.40/GB/month

Choosing Amazon, Google, MS....argues MS is well positioned since they are in the business of selling OS while Google sells ads and Amazon sells books [Note: not a fair comment at all...]
Amazon/Google - how do you connect back to your internal servers? According to him, Azure is the only one that provides a solid solution for this.
Amazon provides a solution for transferring enormous amounts of data - ship it to em on a USB stick. Cheaper and potentially faster.

Azure today supports web role (web sites), worker role (windows service) and communicate between the two using Azure Storage (tables, blobs, queues)

Cloud computing in general -- definitely interesting and useful in our environment. Azure -- not so sure. It seems like there are a lot of new things we would have to do to switch our applications to Azure apps (using their API for accessing config or something), whereas certainly for Amazon, we can get going much sooner.

Tuesday, October 6, 2009

Afternoon Session 1: Maintaining State in ASP.NET Applications

A replacement speaker on this one. The original guy had a fall on his yacht. Now given by Miguel Castro, the same guy who gave the presentations I went to yesterday morning, which were both very good.

Afternoon Session 1: Maintaining State in ASP.NET Applications
Miguel Castro

"Everything in the web is a giant hack." The perception of "state" on a web page is just an illusion!

Cache less dependable than application, but scalable. Things will drop out of cache if it gets to large.
GridView is responsible for growing ViewState in a big way! Performance!
What to do?
1. Don't enable in-line editing. It's confusing and grows ViewState.
2. Disable ViewState.
3. Make the db call again. It's faster than you think.
Sliding cache lets things auto renew in cache.
Potential to make a user specific cache by appending a uniquifying key (like session id) to the key name of the cache.
By default, session id is sent in memory cookie to user browser.
Max timeout for session is 24 hours!
Anything in session has to be serializable.
To clear var from session, use Session.Remove(), not setting to blank.
To avoid sticky sessions, can have .NET use a single server for ALL session storage

Can create a class to wrap session vars - which solves some of the problem of loosely typed values and need for mistyping session name - the session var pull is in the getter/setter for the class instead, and the getter/setter can do the casting.
So something like:
AppSession.CurrentEmployeeId = 10;
Getter/Setter for static CurrentEmployeesId prop actually does the push to\pull from session.
^^ This is good stuff. Yet another thing to do...

Can do cookieless sessions in web.config - set cookieless="true" in sessionState section. Note that data goes in the url...which is ugly.
WebFarm session storage - use mode="StateService" and turn on ASP.NET State Service in Services (off by def).

Pretty simple stuff in this session, but a couple nice tips and tricks here and there.

Morning Session 2: Getting Started with .NET 4.0 and C# 4.0

Going to sit and learn a bit about what's happening in 4.0. This is supposed to be targeted at mid- to high- level .NET developers and focuses a lot more on the framework, not the IDE. I'll try to keep up.

Get his slides (later) from RichardHaleShawGroup.com/downloads.aspx, access code VSLiveOrlando2009

Morning Session 2: Getting Started with .NET 4.0 and C# 4.0
Richard Hale Shaw
Code with Confidence

Wow, this guy HATES Vista. Finally got done with a long rant about it. [My Note: He wasn't done.]
Not talking about F#, and I probably won't go to that session later.
Advances always around producing problem solving code with fewer lines. [My Note: sometimes at the expense of readabilty. Looking at you, lambda functions]
First change to CLR since 2.5

Can now cast generics better...so List of strings can be cast to List of objects just like string can be cast to object - he describes this as a bug fix. Has not come up for me yet, but can see where it would be useful.
Have not worked with LINQ, but some new capabilities to pull data using parallel processes using a simple AsParallel() method. Added stuff to System.Threading.

Dynamic language programming bundled in. C# not dynamic, but can USE objects built by dynamic languages. Basically, any object declared using dynamic (which is...weirdly...a static type) will not throw any compiler errors no matter what methods you call. They turn into runtime errors). I'm very wary about dynamic languages from a code maintainability standpoint, and I hate turning compile errors into runtime ones. But I think the idea of being able to leverage Ruby and Python libraries that build dynamic objects is a good one. I can just see this being abused to write screwy, unreadable, hard-to-maintain code. End rant.

Optional parameters with default values. Woo hoo!
Named parameters so user can pass parameters in any point...and increase readability.
CalculateBMI(weight:123, height:64);

New Tuple object that lets you put any number of objects together on the fly without building a class.
New thread-safe collection class.
Code Access Security is now obsolete. Recommends now OS-level solutions like Windows Software Restriction Policies. Can/should use Transparency Model from Silverlight.

"The biggest mistake we make is assuming that it's more expensive to take the time to do the rewrite than to live with our old junky code."

Presentation was fine, but VERY rushed. Spun through tons of slides really fast, skipping tons of them. Focused on some interesting stuff, but there was just more data than the time slot allowed.

Morning Session 1 - Intro to Silverlight

My indulgent session. I don't know that the lack of adoption will allow us to use Silverlight on the website, but I hear so many good things about it.

Morning Session 1 - Intro to Silverlight
Brian Peek

Dev and deployment easier than .NET
Problems with Silverlight:
1. No native printing support
2. No webcam/mic support
3. Popping outside of the sandbox is still limited
4. Linux support is very weak
5. Adoption is low (by FAR the biggest problem in our environment)

Couple optional tools: Expression Blend (for design) and XAMLPad (quick prototyping)

Very Flex-feeling at first glance. Compiles to xap instead of swf. Uses c# instead of ActionScript. Only thing is that I like that is different is the organization of the codebehind - Flex puts scripts pretty much wherever you want.
Silverlight 3 turned off the designer for performance reasons, or at least hid and disabled by default. That sucks.

Embedding media is REALLY easy. One tag, one prop. Amazing how simple that was.
Style definition billed as "like CSS", but looks really clunky in my opinion. But at least you don't have to worry about cross browser crap.

Can pull app out of browser window and even install to Start menu - Cool! Can't run disconnected like Adobe Air, but WAY easier to do. Basically just a config change to enable.

Nothing in this session that distinguishes Silverlight in any HUGE way from Flex, but carries all the same advantages of Flex for developers. Just have to watch adoption rates.

Keynote - SQL Server 2008 R2:The Data Platform for Software Plus Services

Day 2 begins...

Keynote - SQL Server 2008 R2:The Data Platform for Software Plus Services
Roger Doherty
Senior Technical Evangelist

Couple Silverlight nods given. No real mention of adoption rate...
IIS7 Smooth streaming ability - stream vid a different qualities depending on bandwidth, etc.

Ability to create .NET classes and persist in DB. Even he doesn't see it as that big.
XML as first class citizen. Nice, but did not think that was new.
HierarchyId data type - potentially cool for storing hierarchical data.
Sparse columns - up to 30K columns since columns with NULL are not allocated space. Cool! "SELECT *" only returns non-null cols. Interesting...
Datetimeoffset type supports time zone. Once in a while useful.
Can now persist blobs to NTFS. WAY better performance. Nice, but he's giving the impression that it's very raw still. To quote, "Give it a try maybe in SQL2011."

Indexing better. Filtered index to do something like not indexing null values. Awesome for sparse tables (like FacetEntityValue).
Integrated fulltext search - 2 people in the room had ever used it. He seems disappointed.

Talked specifically about improving/developing JDBC and PHP access APIs.
Fancy talk to say they are working on integrating .NET ORM type capabilities.
Microsoft Synchronization Framework as alternative to replication (more fine grained control)

VS Team Database Edition
Integrated change management code, including source code integration. Nice.
Db refactoring support. Scary powerful.

Some interesting stuff in here. It seems like some of the functionality could be used in place of NHibernate. Don't know which is better. It feels to me (and I could be wrong) that the VS/SQL Server capabilities are really good for a clean model -- all of your stuff coming from SQL Server, classes that look just like your db tables. NHibernate has stuff we use extensively for connecting to other dbs and building a clean object model from twisted data models. Feels like we blow a lot of the MS advantages out of the water when we do that.