Data sync on iPhone, iPod, iPad – the missing link?

Users and particularly developers of Palm’s old line of PalmOS devices will keenly remember that Palm were the only people to get syncing right at the time.

Aside from all the basics, they allowed 3rd party applications on the device AND the desktop to talk to each other directly to sync custom data. I’ve bitched about this before.

As an avid Mac, iPhone, MobileMe and soon to be iPad user, I have to wonder what is happening with this at Apple. My real-world gripe is this:

I was just about to open OmniFocus on my iPhone specifically so that it would sync with the latest data on my MacBook Pro, which is set to sync via MobileMe (using a pretty ugly file based solution). Why am I even doing this? Why isn’t this data synced (a) when I dock my iPhone to sync all the other iTunes stuff, and (b) why can’t it automatically sync wirelessly

Well part (b) is easier to answer, although it is a three-fold answer. First, there’s no background app support to allow automatic sync of the OmniFocus app on the phone. That should be addressed by the Push API functionality except that OmniFocus doesn’t support Push API (server cost to them to do so) and even if they did support Push, iPhone SDK Push is not able to automatically pass the data to the application to force it to sync – the user must acknowledge the event and run the app on the phone manually. It’s a pile of suck, surprisingly, with a real feel of “disconnected device”.

Part (a) is more tricky to answer. It must be trivial for Apple to add this kind of support for direct-to-app syncing. They already have/had Sync APIs for OS X for a long time. Lack of support for this apparently makes no sense.

In conclusion I am very surprised that Apple has not updated the OS X Sync APIs so that:

  • Third party apps can sync any data they like to/from the iPhone/iPod/iPad with iTunes as the conduit (that was the concept’s name in PalmOS if I recall)
  • The transport for sync is completely hidden from the applications such that sync will happen transparently via Dock, Wifi (direct between devices on local Wifi network), and via MobileMe cloud if the device is not on the same Wifi network.

This is not rocket science after all. And yet we still have to know / think about what networks our devices are connected to, manually make sure we run them frequently etc. It is pretty lame, Mr. Jobs.

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark

07

02 2010

My Apple tablet predictions – for what its worth

Might as well join in the fun eh.

Ironically, I think that there will not be that much hardware “frill” with the Apple tablet. I think that actually this is really all about software and the masses of computer users who are not “power users”.

Follow the logic:

Net books are very popular.

The iPhone and the new breed of beyond-smart phones is incredibly popular.

What is the common thread here? Both devices are very portable and offer most of the basic computing that people need day to day. What is it that most people – which I’m afraid guys means non-geeks, the truly massive market beyond geekdom – need?

  1. Email
  2. Web

That’s it. That’s what most people who are not raving geeks need. In fact some geeks may need only that. After all there isn’t much you can’t do with web apps now (e.g. bespin). Google OS/Chrome stuff has been geared to this from the get-go, its not a novel idea.

Functionally, most people also need to be able to write/edit documents that can be read by MS Word – not that they need MS Word, they just need to write out .doc files. This can be done via web apps or via lightweight local apps.

However Apple would not do something like this unless it also offered uniquely integrated stuff.

So on the back of this I reckon the tablet will:

  • Not be that revolutionary hardware wise – eg physically this probably is like a giant iphone
  • To include some web-hosted (with local offline usage) iWork for Pages (= docs & spreadsheets writing. maybe keynote too)
  • Full access to all your iTunes audio and video media and photos (cloud or not) – I would be surprised if this is 100% cloud done at this stage, what with the awful 3G coverage and slow speeds to sync photos and videos. Access to this done “ipod style”, which is a killer recipe as the market has shown
  • A first class large-form factor email app, geared to multitouch
  • And as suspected the delivery of formerly-print media, possibly opening up iTunes marketplace to any author who wants to prepare and sell content. Who knows perhaps you will even be able to create new textual/mixed content on the iPad and sell it via iTunes. This content provision is probably the one really new thing that helps make such a pad a really attractive proposition.

In a nutshell, a beautiful portable computer that is most definitely NOT a laptop because a great deal of people will never see themselves as the laptop carrying kind. However they are likely to part with cash for something that is much smaller than that but a true lifestyle accessory that “just works”. Obviously it will support custom apps and app store too – which has already shown on iPhone that a lot of people just want little stuff that makes life easier.

Several programmers including myself have wondered “Why do I need something like that?”. The answer is if you have an iPhone and laptop, you don’t. The big market win here is not people like us, its everyone else in the real world! Laptops are complete overkill for a lot of people and the netbook market has sort of shown that. They’re not so much winning against laptops as a result of price, they’re winning on form factor and simplicity. If people really needed high-end laptop features, they’d still buy a laptop instead of a netbook.

I’m pretty sure netbooks aren’t aimed at programmers either – although I am confident some masochists code Perl on them and swear that its the best calculator computer they’ve ever had. The tablet on the other hand, is squarely aimed at attacking the netbook and light-use laptop market.

Let’s see what Wednesday brings!

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark

20

01 2010

Weceem 0.8 Released – Highlights and background

I’ve just managed to push out version 0.8 of the Weceem CMS for Grails.

This is a pretty cool if slightly unglamourous release because it has focussed on some performance and security stuff – oh and compatibility with the latest and greatest Grails 1.2.0 release.

Let me first apologise for the ropey typography on weceem.org – we haven’t yet had the time/resources to fix up the CSS styles so things are a little ugly in places. We will fix it as soon as we get time!

Anyway, we added a security policy. This is a groovy script (currently only loaded once at startup) that lets you define what different users can do. This uses a DSL that lets you declare roles and then say what they can do in different spaces, including whether they can admin the space, edit/view/delete/create content, and even do this by URI requested. (see more info and example here)

Because we believe strongly that Weceem should not force you to use a particular authentication library, we had to decouple the policy mechanism from authentication. As a result these roles are completely uninterpreted by Weceem. To integrate and authentication system all you have to be able to do is provide the name, email, login and list of roles for the currently logged-in user. (an example here)

This has enabled some cool stuff in WeceemSecurityService which relies on the security policy. The service has utility methods for implementing our security logic, e.g. isUserAllowedToViewContent(Content c). For example in previous versions of Weceem you could not preview content if it was not in a publicContent status (eg not Published).

Thankfully from version 0.8, anybody who has the EDIT permission can view non-published content. the default security policy ensures that the default administrator account has EDIT permission, so you can preview away as much as you like. We plan future updates to this to allow the security policy to control who can manipulate different types of content, which will be really powerful for people using custom content types.

On the performance front, it became obvious that something needed to be done because the default “index” page installed by Weceem into new spaces was resulting in huge amounts of SQL queries for a single page.

This is because the page is made up like this:

  • It pulls in a Template node for the styling
  • It pulls in three Widgets for reusable HEAD section tags and header and footer
  • The header widget iterates over all root content nodes and their children to render the menu with the wcm:menu tag
  • The page itself links to various StyleSheet and JavaScript nodes to pull in styling and scripts – these are processed on separate requests but still add to the overall burden of the page

This can result in a lot of SQL chatter because we have (rightly so) made no effort to optimize this until now.

There are a couple of areas here that would make a big difference to the SQL traffic.

It is very important to realise that turning on the 2nd level cache in your Grails app’s GORM configuration does not magically give you major performance improvements. My understanding of this rather complex area (which frankly I found very disappointing) is:

  • The 2nd level cache is only used for retrieval by object id. This is very important
  • The query caches are used to cache the ids of objects returned for a given query
  • Query caches are invalidated frequently by Hibernate if your model is not primarily read-only (and can cause some threading contention)

Luckily a CMS is pretty read-only in terms of number of requests that actually read vs update content, so the 2nd level cache is a good candidate for us here.

One of the major SQL hits for Weceem is resolving a URI to the ultimate content node to render. Due to the model we need to query for each part of the URI, so a request for /a/b/c results in three selects. So that’s an easy one – we added URI path -> content id caching (and some other smarts) into the ContentRepositoryService. So once content has been hit, it will always be retrieved by id in future, via the 2nd level cache.

Another issue is iterating over child nodes. This is less trivial. We are using some query caching but I have noticed that some of the criteria were not hitting the caches despite this – it needs further investigation. I think that due to the polymorphic nature of the content model and query cache invalidation issues, we may stop using these in future (think blog comments being submitted and invalidating ALL your caches).

Next up: Template and Widget nodes are GSP pages that we compile and evaluate. It turned out that due to issues in Grails GSP handling (that persist in 1.2 to my knowledge), there is no internal caching of compiled GSP classes built from non-Resource content e.g. strings. This results in a leak of PermGen space which ultimately results in VM collapse. So we now have a simple cache of compiled Template and Widget GSP pages, which is automatically invalidated as necessary when templates and widgets are edited, so it is transparent to the end user that there is a cache.

Finally with regard to performance, we introduced a nice simple wcm:cache tag. This lets you cache fragments of a Template/Widget and hence get major performance improvements. The cache is currently fixed at 1 hour, but its great for anything that pulls in remote content or for any expensive node iteration tags you might be using. More enhancements will come in future.

A couple of nice little things we squeezed in:

  1. The Cancel button is back on the content editor screen, in the “right” place for Windows users (meh) and browsers (who made return always select the first button argh!)
  2. The wcm:link tag now passes through any unused attributes eg class=”whatever”
  3. We added a JS syntax highlighting script to the default space that you can use to render code snippets in your content easily

Anyway, please enjoy this release. Soon time to get started on 0.9 which should see the Blog functionality completed and other refinements.

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark

12

01 2010

Apple iTunes and NAS usage – please fix it Steve!

This is such a nightmare and it only grows with time.

Many many people have this desire: a single place for all their media: music, videos etc.

A NAS device is the place, backed up suitable. The problem is iTunes / Front Row just does not fit with this strategy if you have more than one computer / Apple device.

The core issue is that iTunes does not automatically rescan the media folder for new files. So you can point as many iTunes as you like to a shared location but they will only see the files they add to their libraries via purchasing or importing media.

So you end up with many devices in your house, all with a different view onto your shared media.

To access that new album you imported, you have to manually Add To Library on that iTunes instance, hoping it isn’t set to duplicate the files on the server. When this happens, as it certainly used to for me, you then end up with many copies of albums as you re-create your library from scratch on the various computers over the years.

Add to this the fact that if for some reason your connection to the NAS goes down when you run iTunes, it will revert the media path to the local folder, and you end up with a total mess – a bunch of machines with files only on some of them, their media split between local and NAS, and only the ones that added those files having them listed in their library.

The experience is so un-Apple it is shocking, and it causes daily pain.

It is important to remember that the iTunes Media folder is where it PUTS files that you buy/import – and that is ALL. (There is a new “Automatically add to iTunes” folder there, which seems half-assed to me). The iTunes Library is specific to each computer and is the list of media and the file path to each. This, unlike the media folder that actually stores the media files, is something you do not want to share between computers in many cases.

Now, iTunes 9 added Home Sharing. But guess what, this sucks and blows! Why? It (a) only shares iTunes-purchased content and (b) it duplicates the files to your local HD. Home sharing, I believe has a lot more to do with the iSlate/tablet and their new datacenter – music in the cloud crap – so you can sync your iSlate content without a cable.

Please Apple, it needs to work like this:

How it should work

How it should work

This is relatively simple:

  1. First, never change the media path in iTunes if the previous path is not reachable. Tell the user what is happening so they can fix it
  2. When new files are added, make a bonjour announcement to any other iTunes running (perhaps even wide-area bonjour to make iPhones/Slates pick it up) so that they can instantly add the file to their iTunes library
  3. When a file is not located on the local disks, have a local cache for stuff that the user ACTUALLY PLAYS. My wife doesn’t like all that heavy metal I listen to, so let’s not fill her hard disk with a clone of it eh? iSlate and Apple TV / mac mini media hubs etc can pick up just the files that are needed.
  4. For the occasion when not all the machines / iTunes are running, have iTunes do daily rescan in the BACKGROUND for any new files in the media folder and AUTOMATICALLY add these to the Library. This is not rocket science.
  5. Maintain an “excludes” list on each iTunes library so the user can remove items from their local itunes Library (without deleting it from the NAS) and they will not be offered the file again in a future background sync.

Don’t give me stuff about non-purchased media not having ISRC codes to identify them and de-dupe. You can dedupe on SHA hashes of the media (calculate once and embed in the metadata of the file) and failing that trackdata, and then failing that – USER INTERVENTION eg “There are some new media files added and we don’t know if they are duplicates or not – help me”.

You can even put all these newly discovered files into a special “Newly discovered” place in iTunes where the user can yay or nay them – or have it set to auto-accept (default).

The more and more macs and related devices are sold to households the more shitty this problem becomes and you REALLY REALLY need to fix it Apple. Without the cloud. The cloud is not a solution for terabytes of media being instantly accessible in your living room.

Please. Just do it. iTunes Home Sharing was nearly it, but sadly failed completely to address this.

  • Twitter
  • Slashdot
  • Delicious
  • Evernote
  • Share/Bookmark
Tags: ,

12

01 2010

This is spot on.