Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Estimating database size [closed]

Tags:

I was wondering what you do when developing a new application in terms of estimating database size.

E.g. I am planning to launch a website, and I am having a hard time estimating what size I could expect my database to grow. I don't expect you to tell me what size my database will be, but I'd like to know if there are general principles in estimating this.

E.g. When Jeff developed StackOverflow, he (presumably) guesstimated his database size and growth.

My dilemma is that I am going for a hosted solution for my web application (its about cost at this stage), and preferably don't want to shoot myself in the foot by not purchasing enough SQL Server space (they charge a premium for this).

like image 314
Ash M Avatar asked Mar 02 '09 00:03

Ash M


People also ask

How do you estimate the size of a database?

To estimate the size of a database, estimate the size of each table individually and then add the values obtained. The size of a table depends on whether the table has indexes and, if they do, what type of indexes.

How do you estimate database growth in SQL Server?

Calculate the monthly growth rate by dividing the jobs per month by 10,000 and then multiplying by the database growth rate (i.e. for the internal DB this is 8.5MB for 10,000 jobs). So, 10,000 / 10,000 * 8.5 = 8.5MB/Month. Therefore in this situation the internal database will grow by approximately 8.5MB per month.

How much free space should a database have?

As a rule of thumb you need 3-4 times the size of the database free disk space (this is for a local copy of the data from each database and space for the SQL Script creation).


1 Answers

If you have a database schema, sizing is pretty straightforward ... it's just estimated rows * avg row size for each table * some factor for indexes * some other factor for overhead. Given the ridiculously low price of storage nowadays, sizing often isn't a problem unless you intend to have a very high traffic site (or are building an app for a large enterprise).

For my own sizing exercises, I've always created an excel spreadsheet listing:

  • col 1: each table that will grow
  • col 2: estimated column size in bytes
  • col 3: estimated # of rows (per year or max, depending on application)
  • col 4: index factor (I always set this to 2)
  • col 5: overhead factor (I always set this to 1.2)
  • col 6: total column (col 2 X 3 X 4 X 5)

The sum of col 6 (total column), plus the initial size of your database without growth tables, is your size estimate. You can get much more scientific, but this is my quick and dirty way.

like image 195
Beep beep Avatar answered Oct 03 '22 00:10

Beep beep