smoksnes
smoksnes

Reputation: 10851

BLOB or XML for saving XSD in SQL Server

I have an application where I'm about to save an XSD- or XML-file to DB. I use a SQL Server 2008 R2 (or later) with Entity Framework. I have a form where the user will upload a XSD or XML file. The contents of this file should be stored in DB.

I will never have to look at the specific contents of the XML/XSD once it's stored in the DB, but it will be downloaded later on.

As I see it, I have two approaches:

Approach A.

  1. Upload file.
  2. Read contents of file.
  3. Save contents of file as XML.

Approach B.

  1. Upload file.
  2. Save file as BLOB.

What's the better option here, or is there a (better) third option as well?

Upvotes: 2

Views: 390

Answers (1)

tom redfern
tom redfern

Reputation: 31780

Approach C.

  1. Save XSD file to shared access storage
  2. Store the path in SQL server

I will never have to look at the specific contents of the XML/XSD

So why put it in the DB at all?

it will be downloaded later on

Much easier to retrieve it from a file share than a DB.

Upvotes: 2

Related Questions