Tuesday, May 12, 2009

SharePoint is not a Database!

As users of SharePoint start using lists they start taking advantage of a very intuitive and highly configurable information management tool.  Users who have been using Excel or Access in the past start seeing SharePoint as a kind of rapid application development platform for building structured data applications.  However, this is where SharePoint’s list architecture breaks down because simply:

SharePoint is not a database!

Part of the problem is that business users designing lists are not familiar with basic database concepts - they just want to store their information.  Part of the problem is false advertising by consultants and/or Microsoft that SharePoint is a miracle platform that can do anything - it does some things well but replacing your SQL server or even Access database isn't one of them.  The other problem is there is no really good way for surfacing bi-directionally data from a database into SharePoint – the business data catalogue works only in read only mode and does not allow for updates back to the underlying data store.

Here are a list of some features that a database has that SharePoint does not support - the moment you need these features you will need a real database.

  • Primary And foreign keys: one of the most basic concepts in a database is the enforcement of a unique identifier (either system generated or user supplied) that can identify a record and link across table in parent child relationships.
  • Transactions: if two changes are required to go together and the second change fails you want the first change to be undone (rolled back).
  • SQL language: complex queries can me written in code using a standard language.  Queries can be saved and repurposed.
  • Stored procedures: database programmers can write complex routines that can be called as reusable code blocks. 
  • Indexing and query optimization: used to improve performance, indexing allows the database designer to pre-index specific fields that are frequently used in queries to improve performance.  In addition, most databases have optimization engines that based on what you are trying to fetch will optimize how the data is retrieved.
  • Large data and binary fields: most modern databases allow you to store large binary files such as video files, large volumes of text, images, etc. in the database.  SharePoint can be made to store large files as documents but you only get one per record and a generic binary object. 
  • Access outside of SharePoint: lists are accessible outside of SharePoint but only through XML or programming interfaces.  Lists are not great data stores to be used for line of business applications written independently of SharePoint because the integration is relatively poor in comparison to running a SQL query on a database.
  • Cascading deletes: if a parent record is deleted, its children should also be deleted.  In most databases, this can be configured to happen automatically or else reject the delete of the parent until the children are deleted first.  This eliminates the risk of orphan child records.

These features are considered basic in databases – they have been around for decades and even the most primitive databases such as Access or FileMaker Pro have most of these features. 

Lists are great for flat, changing content especially when attached to unstructured documents.  At least in the current version, lists are not substitutes for databases and shouldn’t be considered so.  If you need a database, then you are better off building a proper database and using SharePoint as a front-end for surfacing that data through reports, dashboards, etc. or as a host for data entry components such as InfoPath forms or custom build web parts.      

19 comments:

Andrew Badera said...

Amen brother! I'm currently porting a legacy Lotus Notes application into MOSS 2007, and it's not fun. I had no say in the architecture, and given the government nature of the contract, it was probably a "replace all of our legacy Notes instances with SharePoint" sort of edict.

Doesn't make me any happier about it however.

Oguz Karadeniz said...

I totally agree that Sharepoint is not a database...(it will probably never be)

However just 3 items I want to point out:

1. All list items have a key (the ID field), which kinda can be considered as a primary key

2. There is no SQL language but very similar (but of course not as poweful) is the possibility of using CAML for simple queries on the lists

3. Binary data in Sharepoint can be used in lists (in the form of attachments). This is however not comparable with binary fields in a database of course.

I personally think the biggest missing link of Sharepoint Lists, is relationships between the lists.

But I guess Microsoft calls it Lists instead of (database)Tables for a reason :)

Overall, Sharepoint Lists are great of small pieces of information, but for real data you will need the database.

senfo said...

Two more facts that you should share:

1) List performance decreases substantially around 2,000 rows.

2) Interoperability with a database is far easier than with a SharePoint list.

Michael Russell and Vicki Fox Productions said...

http://technet.microsoft.com/en-us/magazine/cc434695.aspx

From Microsoft TechNet Magazine, April 2008 -- Microsoft Office
Integrating Access Databases with SharePoint

This article and many others shows how Sharepoint 2007 can be used as a replacement for the data store behind Microsoft Access (ideally 2007) applications, thus obtaining the best of the GUI front end of Access and the Web visibility of Sharepoint.

Pete said...

senfo,

Please stop perpetuating the myth. List VIEW performance tails off over 2000 items. List QUERY performance does not.

When you browse Amazon, do they show you 2000 items? No, they page it, 100 at a time.

Eric Schupps, the Sharepoint Cowboy, knows his stuff about this.

See his post hereIt's a display problem, not a query problem. Please, stop the mis-information

Andy Burns said...

I agree with Pete. Query is fine with over 2000 items.

You can have simple relationships between lists with Lookup columns - but it isn't really the same.

Personally, I think of SharePoint as like a 'Database lite' - but for proper database applications, I use a database ;)

william said...

Hi Friend,! Congratulations for this nice looking blog. In this post everything about Web Development. I am also interested in latest news, Great idea you know about company background. Increasing your web traffic and page views Add, add your website in www.directory.itsolusenz.com/

Rico Ho said...

SharePoint is not a database, it is an ENTERPRISE database! Its data infrastructure provides enterprise features such as check-in/check-out, version control, search, and even recycle bins for deleted records. We have used it to store millions of records for government agency applications (CRM) without any performance issues. It does the job, you only need to know how best to leverage this technology to your advantage. See our case studies at http://www.webparts360.com.

ED said...

I had the idea of creating a sharepoint database storage engine for MySQL. This would provide a SQL interface into sharepoint lists using MySQLs query engine and permit joins between lists for reporting purposes. ...Struggling to find the time to actually build it though :(

Gen-X Coder said...

Seriously, 2000 rows is quite a myth. I've been way over 6000 in datasheet and it is quicker than opening an excel file with the same about of data. I filter, I sort, I play sharepoint admin like its a sport. Query - no problem. I would recommend making custom queries for most users as it just makes life easier.

Gen-X Coder

Andrew Badera said...
This comment has been removed by the author.
Andrew said...

I agree for the most part, however there are features which simulate some items on your basic list. For example -

SharePoint lookups simulate foreign keys.

SharePoint workflows simulate stored procedures.

I agree with the poster who called it "database-lite"

Raul said...

Well written so that a non-techie like me gets it. As one of the other commenters said, in my past experience with ShPt with smaller appls, the inability to link lists was very detrimental to using ShPt in innnovative ways within smaller work units. Of course, you list more important ones for appls of more consequence.

Anonymous said...

How can I get values from these lists? In where these binary data were hold and how can I decrypt them? I accessed to Ms Sql database of sharepoint but I could not find list items. I need to show sharepoint data in Oracle BI dashboards.

Jen said...

This is exactly what I needed to read. I have a small Access db, and I was thinking originally that SharePoint was meant to replace it. Instead, it will just host it, and so my plan will work. Thank you.

nlvraghavendra said...

Your post is duped here - http://pravyns.blogspot.com/2011/03/sharepoint-is-not-database.html

shine said...

Heloo Boss I am New to Share point I feel difficulty in creating sharepoint database let me know how to create a sharepoint database...

Anonymous said...

Just stopped by to say cascade deletes are possible, just not as flexible as in a real DB.

Anonymous said...

Why would you use a proprietary licensed product with limited capabilities when there are open source databases available for free?
Microsoft's argument that Sharepoint has a user-friendly interface and databases don't is hogwash. Nearly all the open-source databases also have user-friendly FREE interface components, both web-based and programmed.