SharePoint API or SharePoint Web services?

Posted on 2010-08-17
Last Modified: 2012-05-10
I have developed an application that parses a text file and uses that data to populate a SharePoint List (add & update) as well as attach any files that may be listed in the text file to its corresponding List Item. I am using the SharePoint API at this point - not the SharePoint Web services.

The issue is permissions. In order to accomplish this I have had to grant the account that this application runs under  an extraordinary level of permissions (for example the account had to be set as SA on the SqlServer that the databases reside on for the  Content, Config, and Admin databases that this SharePoint site uses).

Obviously this is unacceptable in a production environment - and it is now time to move this application to production.

I'd like to know if there are any ways to get around having to grant such privileges to the account that this app runs under, and/or if I should modify the application to use the SharePoint Web services in place of the API.

I chose to use the SharePoint API due to the limiting number of updates that can be made during a batch (160). I can break up my import to work in chunks of say 100 and add list items that way, but I am also concerned about performance if the import were have to import 300 list items and attach 900 3Mb files to that batch 300 List Items(3 per List Item).

Can any/all SharePoint Development experts please offer some advice?
Thank you VERY much for your assistance.

Question by:TC72
LVL 31

Assisted Solution

by:Jamie McAllister MVP
Jamie McAllister MVP earned 100 total points
Comment Utility
SharePoint API sounds right from what you say. I have alarm bells ringing due to the statement about having to grant permissions on the Sql Server.

Where does the application reside?
Is it a timer job or if not what?

Please enlighten.

Accepted Solution

LeicaLouie earned 400 total points
Comment Utility
The need to grant permissions in the SQL server is quite odd! All you should need to do is add permission in the sharepoint site / web / list so the user running the app can add / edit content through the API.

Although using the API sounds OK to me, I'd go with WebServices since I'd keep this app running on a server that is not a SharePoint server. It all comes down to how this app will impact with the SharePoint's server performance and what resources it will consume.

How many server do you have in your SharePoint farm?
How often do you need to run that app to import 300 items and 900 files?

Importing 900 x 3MB files starts to ring some bells here. That's 2.7GB at a time.

How are you designing your SharePoint site to accommodate for that? I would suggest keeping that list on a site in it's own site collection which in turn can live in it's own DB. That way you can have that DB grow without affecting the remaining sites performance.

Also note that by default SharePoint DBs are configured to grow 1MB at a time and if you're importing 2.7GB you'll have lots of auto-grow actions in your SQL and possibly lots of fragmentation in your DB files.

I would suggest increasing the auto-grow value to 500MB or more.

Can you provide more details? Importing such large volume of data can raise some design concerns that should be addressed. Not that this can't be done, but it should be well planned.

Last but not least, did you consider keeping the files in the file system and just add links to these files in the list item? You can then expose the files as a virtual directory in your SharePoint's IIS site.

Author Closing Comment

Comment Utility
I wound up using the SharePoint Web Services for this project.

Once I was able to create a prototype for this application using Web services and CAML it was clear that I was now following the correct path.

I did create this site with its own database. I typically set the database to grow by 100Mb and that seems just fine for this application.

Thanks for the help experts.


Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now