ASP.NET 3.5 CMS Development
上QQ阅读APP看书,第一时间看更新

Why use a database

That's actually a fair question. After all, there are other storage mechanisms such as XML files, which could be used. But none of the other storage possibilities allow us the flexibility, and especially the programmability, of a database. A modern database is capable of holding many millions of records, while being able to search for and retrieve records fitting specific conditions. Exactly what we need to store for our CMS—the content or data.

Databases provide additional advantages over file-based storage such as our simple CMS or even an XML file. While a file on the system can get fragmented through constant changing, causing slower access times, data in a database can be changed at will without changing the access time. Compared to XML files, which get unwieldy after the size of the file exceeds the available memory resources, databases have near unlimited storage capacity. This means our CMS can scale from a simple family web site to a corporate publishing portal.