Umbraco DataType Design

DataType's in Umbraco 4.x

I've often seem people wondering why performances is so terrible when creating Documents, particularly lots of Documents from the Umbraco API. There is a good reason for this, the design of the DataType allows anyone to be able to implement them to do almost anything.

The standard way to use a DataType is to write to the Umbraco database, but you don't have to do it that way, you can write to an XML file, call a web service or actually have no data saving.

Because of this it's up the responsibility of the DataType creator to do the CRUD operations, it's not possible to have Umbraco have some kind of a global save operation (because what if there wasn't a save!).

This does mean that there's the probability for lots of database interaction when you perform CRUD operations, but it does mean that DataTypes are infinitely flexible.

Because of this we were able to produce TheFARM Media Link Checker package for Umbraco. And I'd also hasten a guess that this flexibility also allowed the Google Analytics for Umbraco package to now allow lookups from the content item.

umbracodata-type
Posted by: Aaron Powell
Last revised: 11 Apr, 2010 11:27 AM History

Comments

11 Apr, 2010 11:21 AM

For the Google Analytics package I actually only use xml files, because it seemed like a better choice then to create x number of tables in the database and mix it up with Umbraco/editor content. Also because everything that you see in the Statistics section is a configuration/configurable in one way or another.

When you first have the custom content tree up and running its pretty easy to create a content picker data type, so you can use your custom data throughout Umbraco if that is what you want. So I can only agreed with you on this, as I found the DataType design to be pretty flexible.

11 Apr, 2010 11:27 AM

Morten - What I was more referring to was that you have a DataType which doesn't read/ write the to the Umbraco database

Petr Snobelt
Petr Snobelt
12 Apr, 2010 02:10 PM

Some time ago I'm thinking about nhibernate layer for umbraco (can be performance booster with enabled cache), but I never realize it and hope that umbraco 5 have it by core team :-)

12 Apr, 2010 11:51 AM

You can't use them asynchronously as they require the HttpContext. If you were seriously concerned about performance you'd write your own CRUD layer to replace Umbraco ;)

Petr Snobelt
Petr Snobelt
12 Apr, 2010 10:13 AM

Hi Aaron, thanks for the clarification.

Now we know reason :-), but what's recommended solution?

What about calling save on DataTypes asynchronically?

blog comments powered by Disqus