QCon. Day Two Tutorials.
Microsoft Asynchronous RT (Erik Meijer,Dr. Mystical ,Paul Betts).
How is mathematical Duality like a Dutch date?
Dr. Mystical Explains Standard Deviations.
Paul Betts: It’s alive! ALIVE!!
Views Around San Francisco on Day Two.
I used Picasa on my laptop to import the JPEG files to my hard drive.
Picasa automatically sync the photo to my Goggle+ account ‘in the cloud’.
I transfered the photos to be edited to my Nexus 7 via the Picasa Tools applet.
Edited these photos using the Adobe Photoshop Explorer applet.
This was composed on the WordPress applet.
I followed this painful path since I wanted to exercise three applets so I could take the Nexus 7 out for a spin around the Google ecosystem. Life would have been simple if the Nexus 7 could read the SD in my camera via the USB mount on the Camera. But alas this will not work with the Nexus 7. There are rumors that if I have an SD reader I can read the SD card directly via USB.
Day One Photos can be found here.
I am getting ready to attend QCON 2012 in San Francisco, this will be my third QCon SF. You can read my posts for the 2011 edition here and here. I enjoy QCon and find the tutorials especially useful. But let me say right off that I don’t attend on my own dime. In the past I have attended QCon and Microsoft’s MIX conference. Sadly, Microsoft has decided to kill MIX, this is bad for Microsoft and for the developer community. I have written posts about MIX here. Now that MVC 4 is open sourced, one wonders why Microsoft corporate has killed MIX.
The tutorials include a full day session on cross platform development using Phonegap. Robinson and Weber who presented an excellent and well attended session on RESTful Development will return with a Neo4j programming class. With excellent timing Peter Bell will present a four hour tutorial on CoffeeScript. If there was a MIX 2012, they would be talking about how MVC4 is supporting CoffeeScript (sigh). Track and tutorials can be found here and here. Note the venue has also changed this year from the centrally located, and very urban, Union Square area of SF to the more up scale Embarcadero area. For folks who like to explore the city, as opposed to pub crawling, this is a bummer. But it is ocean view and close to the (now departed) Occupy SF site.
Well, that’s the basic facts, now the question is: Should YOU attend QCon 2012? The best part of QCon is that it is not a standard vendor conference and (except for Agile) nobody is trying to sell you anything. The attendee’s tend to be working programmers from startups in the SF area and from Europe which helps the sessions to be very focused on what really works. for programmers and startup firms. There is no focus on mega systems like Oracle products or SharePoint. In this environment, couchdb (and this years bad boy Neo) are about as establishment as you get. QCon has traditionally been very friendly towards NO SQL databases and has been I consistent good sorce for information on this topic. This year promises to continue in this trend. I regularly avoid pure vendor sessions so of the three days of regular conference sessions I can look forward to about 2.5 days of good sessions. The tutorials that I have attended are top notch and honest. I can not evaluate the daily keynote speeches since I am normally sleep in past these. Attendees have told me the keynote party and mixer is nice but I am always in the Haight district when this happens on Wednesday night. If the boss is paying and you are coding the web and web devices you must attend this conference. If it’s your dime….
I will be bloging QCon 2012 on my Nexus 7
Let me say write off that I do not pay for my own ticket to QCON, my boss picks up the tag. I love QCON. It is definitely not MIX. I go there to see what is happening in the world which is NOT Oracle and Not Microsoft. That’s the same reason I read their online Zine: InfoQ. QCon always provides a look at what is current and recent in the open stack world. This year we looked closely at REST, Mobile development, Web API and NOSQL. As they did last year QCON provides a nice look at what is open and emerging. Big metal with always be with us but the desk top is looking very weak during the next few years while Mobile devices of all kinds and makers are exploding. The biggest fall out is that while HTML5 is only slowly emerging on desktops in place, all new Mobile devices (which is to say most new systems) will be fully HTML5 compliant. Not only that but with the exception of Windows Phones, the rendering engine for all mobile devices is based on WebKit. What this mean for those of us in the cubes is that worrying about how to bridge to pre-HTML5 browsers with HTML5 code is a non-issue. Mobile development is HTML5 development. The big metal end of the supply chain is being segmented into Web API servers (which service JSON XHR2 data calls) and the NOSQL engines which serve the WEB API farms. Remember a native mobile app ideally has pre-loaded all of its pages its interactions are solely over JSON XHR2 for data (be it documents, data or HTML fragments). The traditional JSP or ASPX web server is not really in play with native mobile apps and has and increasingly small role to play in “native like” or browser based mobile apps. Let’s move on.
“IPad Light by cloud2013”
Speaking of moving on: There is an occupation going on in this country. I visited occupations sites in San Francisco, UCal Berkeley and Berkeley “Tent City”. These are all very active and inspiring occupy sites. Now if we can only get to Occupy Silicon Valley!
Workshop: REST In Practice by the Authors: Ian Robinson & Jim Webber
Why REST? The claims:
· Fault Tolerant
· Loosely coupled
Questions / Comment:
Do we agree with these goals?
Does REST achieve them?
Are there other ways to achieve the same goals?
REST design is important for serving AJAX requests and AJAX requests are becoming central to Mobile device development, as opposed to intra-corporate communication. See Web API section below.
Occupy Market Street (San Francisco)
The new basic Document for REST: Richardson Maturity Model (with DLR modifications)
One URI endpoint
One HTTP method [Get]
One HTTP Method [Get]
Century Level HTTP Codes (200,300,400,500)
Multiple HTTP Methods
Fine Grain HTTP Codes (“Any code below 500 is not an error, it’s an event”)
Media Format Negotiation (Accept request-header)
Headers become major players in the interaction between client and server
Level 3: The Semantic Web
Level 2 plus
Links and Forms Tags (Hypermedia as the engine of state)
Plus emergent semantics
<link rel=”self” href=http://restbucks.com/quotes/1234 type=”application/restbucks+xml”/>
<link rel=”rb:order-form” href=”http://restbucks.com/order-forms/1234″ type=”application/restbucks+xml”/>
Think of the browser (user) as a finite State Machine where the workflow is driven by link tags which direct the client as to which states it may transition to and the URI associated with each state transition.
The classic design paper on applied REST architecture is here: How To GET a Cup Of Coffee. Moving beyond level 1 requires fine grain usage of HTTP Status Codes, Link tags, the change headers and media type negotiation. Media formats beyond POX and JSON are required to use level 3 efficiently (OData and ATOM.PUB for example).
Dude, where’s my two phase commit? Not supported directly, use the change headers (if-modified, if-non-match, etag headers) or architectural redesign (redefine resources or workflow). Strategic choice is design of the finite state machine and defining resource granularity.
(Slide from Rest in Practice)
The Bad Old Days: One resource many, many ‘verbs’.
The Happy Future: Many, many resources, few verbs.
The Hand Cuff Era: Few Resources, Few verbs.
The Greater Verbs:
GET: Retrieve a representation of a resource
POST: Create a new resource (Server sets the key)
PUT: Create new resource (Client sets the key); ( or Update an existing resource ?)
DELETE: Delete an existing resource
Comment: The proper use of PUT vs. POST is still subject to controversy and indicates (to me) that level 3 is still not well defined.
Typically they say POST to create a blog entry and PUT at append a comment to a blog. In Couchdb we POST to create a document and PUT to add a revision (not a delta) and get back a new version number. The difference here is how the resource is being defined, which is an architectural choice.
The Lesser Verbs:
OPTIONS: See which verbs a resource understands
HEAD: Return only the header (no response body)
PATCH: Does not exist in HTML5. This would be a delta Verb but no one could agree on a specification for the content. Microsoft did some early work on this with their XML Diffgram but no one else followed suit.
Authentication (in order of increased security)
Basic Auth + SSL
WSSE Authentication (ATOM uses this)
Message Level Encrypt (WS-SEC)
For the Microsoft coders I highly recommend
RESTful .Net (WCF For REST (Framework 3.5) Jon Flanders
There are significant advantages to building your RESTful services using .Net. Here is a comparison table to get you oriented:
DLR’s Cross Reference:
||Web Service Standard
||WCF For REST (Framework 3.5)
||TCP/IP + others
||Basic Auth/SSL or WS*Security
||HTTP Response Codes
||HTTP Response Codes
||Multiple Endpoints, URI Templates
||Multiple Endpoints, URI Templates
The REST of the Week
Wednesday is more or less vendor day at QCON and the sessions are a step down from the tutorials but the session quality picked up again on Thursday and Friday. XXX XXXX who gave an excellent tutorial last year gave an informative talk on ‘good code’. The Mobile Development and HTML5 tracks were well attended and quite informative. The fie ld is wild open with many supporting systems being free to the developer (support will cost you extra) and the choices are broad: from browser ‘responsive design’ application to native appearing applications to native apps ( and someone threw in “hybrid app” into the mix). The Mobile panel of IBM DOJO, JQuery.Mobil and Sencha was hot. I am new (to say the least) to Mobile development but here are my (somewhat) random notes on these sessions:
MOBILE Development is HTML5 Development
HTML5 is the stack. Phone and Tablet applications use WebKit based rendering engines and HTML5 conformant browsers only (Windows Phone 7 is the exception here). HTML5 has its own new security concerns ( New Security Concerns)
Three major application development approaches are:
· Browser Applications;
· Native like Applications;
· Hybrid Applications; and
· Native Applications.
Browser applications may emulate the screens seen on the parallel desk top browser versions on the front end but in practice the major players (Facebook, YouTube, Gmail) make substantial modifications to at least the non-visual parts of the Mobile experience making extensive use of local storage and the HTML5 manifest standard for performance and to allow for a reasonable off line experience. Browser applications fall under the guidelines of Responsive Design (aka adaptive Design) and tend to be used when content will appear similarly between desktop and Mobile devices.
“Native like” applications use:
· The Browser in full screen Mode with no browser ‘chrome’; and
· Widgets are created using CSS, JS and HTML5 which simulate the ‘look and feel’ of a native application;
· No Access to Native Functionality (GPS, Camera, etc)
· Tend to use, but does not require use of HTML5 manifest or local storage but it is strongly encouraged.
A Native application is still an HTML5 application with the following characteristics:
· All JS Libraries, CSS and HTML are packaged and pre-loaded using a vendor specific MSI/Setup package;
· AJAX type calls for data are allowed;
· Access to Native Widgets and/or Widgets are created using CSS, JS and HTML5
· Access to Native Functionality (GPS, Camera, etc)
· Standard HTTP GET or POST are NOT allowed
AJAX calls are made via XHR2 (aka XMLHttpRequest Level 2) which among other things relaxes the single domain requirement of XHR and processing Blob and File interfaces.
The following major vendors offer free libraries and IDE for development:
Native Apps: PhoneGap, Appcelerator
Native App Like: Sencha, PhoneGap, IBM Dojo
Browser App: JQuery.Mobile
PhoneGap does NOT require replacement of Sencha, JQuery.Mobil, Dojo.Mobile JQuery libraries.
Sencha does not require replacement of the JQuery.Mobil, Dojo.Mobile JQuery libraries.
Although it is theoretically possible to create “Native like” applications with only JQuery.Mobile this is NOT encouraged.
This is a major area of performance efforts and is still very much open in terms of how best to approach the problem:
The major elements are:
App Cache (for pre-fetch. and Native App Approach)
DOM Storage (aka Web Storage)
IndexedDB (vs. Web SQL)
File API (this is really part of XHR2)
Storing Large Amounts of Data Locally
If you are looking to store many Megabytes – or more, beware that there are limits in place, which are handled in different ways depending on the browser and the particular API we’re talking about. In most cases, there is a magic number of 5MB. For Application Cache and the various offline stores, there will be no problem if your domain stores under 5MB. When you go above that, various things can happen: (a) it won’t work; (b) the browser will request the user for more space; (c) the browser will check for special configuration (as with the “unlimited_storage” permission in the Chrome extension manifest).
Web SQL Database is a web page API for storing data in databases that can be queried using a variant of SQL.
Storage Non-Support as of two weeks ago.
What is it? Just a name for breaking out the AJAX servers from the web server. This is an expansion of REST into just serving data for XHR. It is a helpful way to specialize our design discussions by separating serving pages (with MVC or whatever) from serving data calls from the web page. Except for security the two can be architecturally separated.
Web APIs Technology Stack
Look familiarr? Looks like our old web server stack to me.
The CAP Theorem (and Here)
- Consistency: (all nodes have the same data at the same time)
- Availability: (every request receives a response – no timeouts, offline)
- Partition tolerance: (the system continues to operate despite arbitrary message loss)
Pick Any Two
If some of the data you are serving can tolerate Eventual Consistency then NOSQL is much faster.
If you need two phase commit, either use a SQL database OR redefine your resource to eliminate the need for the 2Phase Commit.
NoSQL databases come in two basic flavors:
Key/Value: This are popular with content management and where response time must be minimal. In general you define what btrees you want to use before the fact. There are no on the fly Joins or projects. MongoDB and CouchDB are typical leaders in this area.
Column Map: This is what Google calls Big Table. This is better for delivering groups of records based on criteria which may be defined ‘on the fly’. Cassandra is the leader in this group.
Sad to say this is still not standardized and preliminary support libraries are still a little rough. Things do not seem to have moved along much since the Microsoft sessions I attended at MIX 11.
Photos: All Photos by Cloud2013
QCON the software conference hosted by InfoQ will be meeting in San Francisco next month form November 14 through November 16. I attended last years conference and am looking forward to attending again this year.
I am also a regular attendee of the Microsoft MIX Conferences. Even though both of these conferences focus on Web development the contrast between these two conferences could not be greater. First off MIX is much larger and is of course devoted to all things Microsoft. MVC 3 was the big push this year at MIX. This is a very strong development approach for Microsoft doing its ‘embrace and extend’ dance which it does so well. In this case source is Ruby on Rails and its approach to standard MVC development. MVC 3 (and Microsoft) approaches the Web from the perspective of the corporate developer of (basically) client server architecture. But it is not a bad or evil effort. Indeed the improved and streamlined http pipeline used by IIS for MVC is fast, the tools development environment are well thought out and, once you drop down a level the low level support for Rest(ful) approaches, JSON and HTML templates is impressive. In addition to JSON and JQUERY, Microsoft is also a strong supporter of the emergent ODATA standard. I recommend MIX (and the Channel 9 videos of the conference) to anyone working with or considering Microsoft development tools. I always learn new things are gain important information on how to advance the web at MIX. You can read more details on the sessions here.
In terms of big metal companies MVC 3 and Framework 4.0 are much stronger than anything Java EE has to offer. The biggest problem Microsoft has is that it can not seem to ship its HTML5 compatible browser and so it’s development systems do not optimize for (or even in some cases take advantage of) the strongest and newest features of HTML5. In addition, try as they will two things Microsoft will never be is cutting edge or free. Over in the LAMP and Rails and NOSQL world QCon is offers a look at how the world of the web will be (or at least could be) if any of the independent developers who make up most of QCON’s speakers and attendee’s are able to hit the mark with the next big thing. It’s always a mixed bag of nuts at QCon, a nice mixture of visionaries and hucksters, Rastafarians and Agile advocates. I like this conference because in addition to providing me with some alternative voices to the Google and Microsoft and Oracle, it also forces me to both re-evaluate the way I am doing things and to think independently about HOW we can do web development. And San Francisco is a much better venue than La$ Wage$. This is a hacker fest without the emphasis on cool technique not how to create the next big thing (product or Brand). This is NOT Web 2.0 Summit which is about venture capitalism defining the web. Alexia Tsotsis will not be covering this.
By the way, if you are not reading InfoQ on the web regularly you ARE missing out.