Posts Tagged ‘modern web technologies’

HTML5 gets a database

June 9, 2011

As a relative late comer to HTML5 trying to catch up on a spec that spans over a 1000 pages is no mean feat, let alone the fact that the definition of what makes up HTML5 is covered across several specs (see previous blog on standards spaghetti). If you’ve been following this series then you’ll have worked out I have a few favourite features that I think will radically change the perception of web applications, and you guessed it HTML5’s support for database access is another.

The specification started out as early as 2006 with WebSimpleDB (aka WebSQL), and went as far as implementation into many browsers including webkit, Safari, Chrome and Firefox. From what I can find Oracle made the original proposal in 2009 and the W3C made a switch to Indexed DB sometime in 2010. Although Mozilla.org already had their own implementation using SQL-Lite, they too preferred IndexedDB). The current status as of April 2011 of the IndexedDB spec is that it is still in draft, and according to www.caniuse.com early implementations exist in Chrome 11 and Firefox 4. Microsoft have released a prototype on their html labs site at to show their current support .

Clearly it is not ready for live commercial applications in the short term, but it is certainly something worth keeping your eye on and to plan for. When an application requires more than simple key value pairs or requires large amounts of data, IndexDB should be your choice over HTML 5’s WebStorage api’s (localStorage and sessionStorage).

The first important feature about IndexDB is that it is not a relational database but in fact an object store. Hence there are no tables, rows or columns and there is no SQL for querying the data. Instead data is stored as Javascript objects and navigated using cursors. The database can have indexes defined however.

Next there are two API modes of interaction, Asynchronous and Synchronous API’s. As you would imagine synchronous API’s DO block the calling thread (i.e each call waits for a response before returning control and data). Therefore it follows that the asynchronous API’s do NOT block the calling thread. When using asynchronous API’s a callback function is required to respond to the events fired by the database after an instruction has been completed.

Both approaches provide API’s for opening, closing and deleting a database. Databases are versioned, and each database can have one or more objectstores. There are CRUD API’s for datastore access (put, get, add, delete) as well as API’s to create and delete index’s.

Access to the datastore is enveloped in transactions, and a transaction can be used to access multiple data stores, as well as multiple actions on a datastore.

At a very high level, there you have it, IndexDB is a feature that allows you to manage data in the browser. This will not only be useful for online applications (e.g. a server based warehouse could export data cubes for local access) but also for offline applications to hold data until a connection can be established. I’d fully expect a slew of Javascript frameworks to add value ontop of what the standards provide, indeed persistence.js is one such example.

It’s good to see early implementations and prototypes for IndexDB and whilst the date for finalising this spec is unclear, I for one will be monitoring it’s progress closely and waiting with baited breath for it’s finalisation.

http://www.w3.org/TR/webdatabase/

http://www.w3.org/TR/IndexedDB/

http://hacks.mozilla.org/2010/06/beyond-html5-database-apis-and-the-road-to-indexeddb/

http://trac.webkit.org/export/70913/trunk/LayoutTests/storage/indexeddb/tutorial.html

Does HTML5 means the end of Flash?

March 24, 2011

I am almost starting to feel sorry for Adobe Flash. First it was Steve Jobs, now everyone is starting to recognise the inherent limitations of the proprietary multimedia platform.

The Apple chief executive took a swipe at Flash earlier this year, suggesting the development tool is poorly designed, has security concerns and is ill equipped for the mobile age.

Action was tough, with Apple banning Flash from its iPhone in 2007 and its iPad in 2010. I wrote in November that the attractiveness of the platform would undoubtedly be affected by Apple’s decision (see further reading).

That would have been bad enough. But then it seemed everyone else turned up to give Flash a good kick in its multimedia platform. Such a backlash centred on the next-generation we framework HTML5.

Microsoft, a long-time defender of its own development framework Silverlight, has started to show open support for HTML5. Google has added HTML5 support for video playback and Facebook, with Facebook also going with the standard to provide video on Apple devices.

Such moves help illustrate how organisations are keen to break away from third party plug-ins. What once seemed normal, even convenient, now seems painful – users and suppliers want everything at once and they don’t want to rely on yet another multimedia platform.

It’s been a tough fall from grace for Flash. As well as the aforementioned ability to view movies, Flash also boasted a range of other snazzy and original features. Like video, Flash was able to support rich graphical applications and games. Once again, its originality has been trumped by HTML5.

Where Flash once offered a means to cross-browser reach, HTML5 provides a standards-based approach that is hooking in vendors and removing the necessity to rely on plug-ins.

HTML5’s additional ability to support the running of applications offline provides another significant benefit and a further break from a reliance on workarounds like Flash, Google Gears and Microsoft HTML Applications.

In short, HTML5 has the big backers and the big technology. It is a standards-based approach to web development that is paving the way for portability and accessibility, regardless of location, browser or device.

In comparison, Adobe Flash looks a bit old hat. No wonder Steve Jobs felt so frustrated. The only question is why, in the future, anyone would choose to go with Adobe Flash?

Jobs will not be alone in swerving away from Flash and towards HTML5. Get ready to switch lanes now.

Further reading:

http://www.businesscomputingworld.co.uk/apple-vs-adobe-round-two-could-herald-the-knockout-blow/

Does HTML5 mean the end of the road for Gears, HTA and Flash?

March 10, 2011

Web standard HTML5 contains loads of great features, from video playback to drag-and-drop. But the best bit, and currently one of the least talked about elements, might be the capability to run apps offline.

The normal web experience is hindered by connectivity. Users can typically access web apps while they have a connection to the internet. Once offline, individuals lose access to email, calendar or notes. There are, of course, workarounds. Google Gears, for example, allows users to navigate compatible sites offline and synchronise when back online.

Microsoft HTML Applications (HTA), meanwhile, is a Microsoft Windows formalisation that provides a web-like experience offline. And Adobe Flash can also be run offline, allowing users to run Flash-based content.

Such workarounds are OK but they are also a bit messy. People want the same experience online or offline; they want to get hold of – and manipulate content – regardless of location and they don’t want to be hindered by platform specific technologies or plug-ins.

HTML5 provides that standardisation. Its two–pronged approach re-connects the user through an SQL-based interface for storing data locally, and an offline cache that helps ensure apps are always available (see further reading, below).

With regards to availability, HTML5’s application cache mechanism provides the ability to have a fall back page for rendering pages when offline. It also provides a means to update cache dynamically. The key, here, is client-side management.

And without wanting to bang my own drum too loudly, it is a rhythm I have been hinting at for a long, long time. I blogged two years ago (see further reading) about client-side management as a method for keeping data in the browser, rather than the server, and as means to reducing memory and processing requirements.

“If only it was supported as standard by the browser rather than having to use hidden fields,” I concluded – and now that day is fast approaching. HTML5 creates a standards-based method for creating local apps that run offline.

As mentioned earlier, HTML5 also provides the ability to store data locally through a client-side SQL database. A series of apps could potentially work with this database, providing a new level of accessibility and integration.

The total approach represents a huge step forwards for web development. It also signals that the end is nigh for proprietary workarounds like Gears, HTA and Flash. HTML5 is the future and web developers simply must get with the program.

Further reading:

http://www.w3.org/TR/offline-webapps/

http://blogs.computerworlduk.com/facing-up-to-it/2008/07/client-side-session-management/index.htm

The new legacy is HTML !

November 22, 2010

The legacy of past computing decisions is one of the biggest technology challenges facing businesses. What’s more, lessons from the past are not being heeded.

Let’s start with the most famous legacy code of them all – because if you’ve encountered COBOL, you’ve encountered legacy. Invented in 1959, the object-oriented language became a mainstay of business computing for the next four decades.

The legacy, however, quickly turned into a significant burden. Gartner reported that 80% of the world’s business ran on COBOL in 1997, with more than 200 billion lines of code in existence and an estimated 5 billion lines of new code produced annually (see further reading, below).

The reliance on that rate of production came home to roost towards the end of the last century, when language problems led to the panic associated to Y2K. The story since then has been one of decline. The continued move of business online has led to a clamour for new, sleeker and internet-ready programming languages.

First specified in 1990, HyperText Markup Language (HTML) became the predominant web development language. Its use ran alongside the development of open standards, such as JavaScript and the Cascading Style Sheets of CSS.

Such languages and styles helped to define the layout of the Web. But that is far from the end of the story. Online development in the era of HTML has become increasingly patchy, with more and more developers using varying styles of code.

Additional online tools, such as Silverlight and Flex, create further complexity. The result is that HTML, and an associated collection of standards and tools, are fast becoming the new legacy.

Just as in the case of COBOL, more and more lines of code are being produced. The disparate pace of online development is such that we will end up with reams of legacy HTML, JavaScript and CSS code.

Learn from history and get to grips with the problem now. Make sure you have proper documentation and standards. Select tools that are integrated with the rest of your business processes and which allow users to make the most of earlier development projects.

Think about how certain approaches – such as a mix of HTML/JavaScript and Ajax-server based technologies – will allow your business, and even your end-users, to use the same development techniques on desktop and mobile environments.

Also look to the future and take a look at HTML5, which is currently under development as the next major revision of the HTML standard, including features that previously required third-party plug-ins, such as Flash. Don’t stop there carry on with CSS3, Web Worker and WebFonts all new evolutions of current web technologies that will tomorrow be mainstream.

The end result should be the end of fragmented development and a legacy of useful web applications, rather than unusable and unidentifiable code.
Further reading:

http://www.wired.com/thisdayintech/2010/05/0528cobol-conference/


Digg!

Can the BBC afford to take their eyes of HTML5?

October 4, 2010

You sometimes read an opinion that stands out and stops you in your tracks – and the below sentiment from a senior BBC executive about the next major revision of the HTML standard left me stunned.

 “I have concerns about HTML5’s ability to deliver on the vision of a single open browser standard which goes beyond the whole debate around video playback,” says the BBC’s future media and technology director Erik Huggers (see further reading, below).

 That viewpoint takes a negative approach to a fast-developing and – most importantly – open standard. The World Web Web Consortium (W3C) recently released the latest HTML5 draft specification, which will include native video support and will reduce the need for additional plug-ins and enhancements.

 It is a crucial step forwards. Providers currently take a disparate approach to web development, using a varied sample of codes, styles and plug-ins to produce the user interface. Such fragmentation often produces a disappointing web experience, with users aware that different browsers have different capabilities.

 HTML5 could be the start of something different. The standard already boasts some big backers and impressive features. Take Apple’s Steve Jobs, who is a passionate advocate and refers to HTML5 as the new web standard (see further reading).

 Microsoft, meanwhile, recently performed W3C Web Standards tests on the forthcoming Internet Explorer 9 (see further reading). For its part, Google has been using HTML5 to enhance the web-based version of Gmail and has even coded a Gmail-themed ‘shoot-em-up’ in HTML5 (see further reading).

 Most of the IT world, therefore, is preparing itself for an inevitable switch to HTML5. Apart from, it would seem, the BBC. Is the organisation right or wrong?

 Criticism of the BBC centres on the suggestion that its support of Flash belies broader support of open standards. Huggers suggests the organisation’s use of Flash is not a case of BBC favouritism and is the best way to deliver high quality video experience to the broadest possible audience. 

 More specifically, Huggers believes there is still a lot of work to be done on HTML5 before the BBC can integrate it fully into its products. But while work does need to be done, progress is remarkable.

 I believe Huggers is wrong to suggest that HTML5 progress is sailing off course and slowing. Backers are lining up to support the standard and, as stated above, the latest revisions to HTML5 have only just been released.

 The bandwagon for HTML5 has started to roll. Organisations either jump on now or get left behind. Way too many people want open standards-based solutions for HTML5 not to be a success. The BBC should not let its current requirements for video playback distract its attention away from the fast pace of web development.

Further reading:

 http://www.bbc.co.uk/blogs/bbcinternet/2010/08/html5_open_standards_and_the_b.html

 http://www.neowin.net/news/internet-explorer-9-beta-due-on-september-15

 http://www.apple.com/hotnews/thoughts-on-flash/

 http://gmailblog.blogspot.com/2010/08/galactic-inbox-html5-game-inspired-by.html