Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a limit size for a SQL Server database?

Tags:

c#

sql-server

I am going to develop a system in C# in which documents have to be scanned and stored and I am expecting that the size of the dB will reach to 3-4 terabytes.

My question is it possible to store them in the database or there is a limit for the DB, or do I have to store them in folders?

Thanks in advance

like image 946
Eng HanGhul Avatar asked Dec 24 '22 05:12

Eng HanGhul


2 Answers

Yes there is a limit, it depends on what version of SQL server you are using. If you are using Express:

https://www.gfi.com/support/products/what-are-the-size-limitations-for-sql-express-databases

Microsoft SQL Server 2005 Express edition has a database size limit to 4GB
Microsoft SQL Server 2008 Express edition has a database size limit to 4GB
Microsoft SQL Server 2008 R2 Express edition has a database size limit to 10GB
Microsoft SQL Server 2012 Express edition has a database size limit to 10GB
Microsoft SQL Server 2014 Express edition has a database size limit to 10GB
Microsoft SQL Server 2016 Express edition has a database size limit to 10GB

However other versions have much higher caps:

https://blog.sqlauthority.com/2013/07/21/sql-server-what-is-the-maximum-relational-database-size-supported-by-single-instance/

From the above link:

SQL Server 2008R2, 2012 and 2014 have maximum capacity of 524 PB (Petabyte) in the Enterprise, BI and Standard edition. SQL Server Express has a limitation of 10 GB due to its nature.

So if you are not using Express, pretty much no real limit.

You may consider simply storing those files somewhere and simply using SQL to point to where they are stored and perhaps some meta data about the file. Importing those huge files into SQL really won't get you much, and making managing the database that much harder (backups, performance, etc.) As TomTom and dlatikay pointed out leveraging FILESTREAM may be another option.

like image 198
sniperd Avatar answered Dec 25 '22 18:12

sniperd


There isn't a size limit per say, but performance could be a real issue. I would however say that don't store the scanned documents themselves in the SQL server database as a blob, but rather store a pointer like a file location or S3 bucket location with the document. It would be a generally more performant solution

like image 35
Eric Yang Avatar answered Dec 25 '22 19:12

Eric Yang