Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

storing design file (contents) in sql server and performance

Posted on 2012-03-31
6
Medium Priority
?
525 Views
Last Modified: 2012-08-14
Hello,

I'm writing a code which is dealing with dxf files (basically is a text file generated by AutoCad). now, in a part of the project I need to store it. Its contents can be something like:


ENDBLK
  5
204
  8
0
  0
BLOCK
  8
0
  2
SW_NOTE_3
 62


however, it gets to several thousands of lines. I'm thinking of saving it in a field as Varchar(MAX) which supports up to 2GB of information.

1.

Can an expert advise me on this?

2.

the code will read dxf files from an input and stores them in sql server 2008 and yet it has to be able to reopen and show the design. this make me think of storing the files on storage device and instead store only the path/file name in the database since there will be more steps that have to go through connecting to the database, locating the data, reading the contents and creating a temp dxf file. Any advice?
Thanks.
ak
0
Comment
Question by:akohan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 320 total points
ID: 37792463
I would just put the path/file name in the database.  Putting the file itself in the database can take up a lot of space which can slow the database access down, requires a program to recreate the file (wasting more time), and can only be backed up by backing up the database.
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37793865
in case you still want to store file content in DB rather than its path, use varbinary(max) instead of varchar(max)...

here is an example to help you:-
http://www.codeproject.com/Articles/114892/Saving-Files-Into-Database-Using-NET-Web-Services
0
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 480 total points
ID: 37795601
Save the file in a common place with unique name and store the full file path in DB. While you need it read the file. If you want to improve the performance you can use Caching technique. Please do refer http://www.4guysfromrolla.com/articles/100902-1.aspx.
0
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 37795608
Each file name should be unique and the same could be use as Cache KEY.
0
 
LVL 35

Expert Comment

by:sarabande
ID: 37805703
you might zip the file and store the zipped binary into a blob (varbinary). that would spare a lot of space and would be faster for both write and read cause zip/unzip was made in memory.

Sara
0
 

Author Closing Comment

by:akohan
ID: 37852344
Thanks
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

688 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