I’m working on a Card Management application in Asp.net Mvc. We are using Fluent Nhibernate as ORM and Sql Server 2008.
We are now considering to not really delete the data, when the user chooses to delete it.
My question is, what is the best way to do that and also what are the consequences of this(Performance, Db size)?
Some important tables of our database, may have thousands of records.
Thanks in advance.
I never thought this was a good idea, especially when foreign keys are involved. This can really make things more complex than they need to be. And I never liked the idea of records that are deleted but not really deleted. This is just messy, IMO.
If you want to keep deleted rows around, I would suggest putting them in an archive or history table of some sort. That way you have them there for future analysis, if you need to, and can bring them back later, if necessary.
The size of your database really isn’t an issue. “Thousands” of records is nothing for SQL Server. In our manufacturing database, we have hundreds of millions of rows in some of our tables. Performance is excellent.
With SQL Server 2008, you have Change Data Capture available to you, which can, very nicely, handle deleted rows for you.