php - Are databases always the solution in web data storage? -


i haven't got experience databases, intends learn , use on web project i'm planning.

though, i've got advice pal of mine use of databases should quite more extensive planned. believes in keeping of data in databases, find databases convenient regarding perhaps user data (just tiny pieces of data), , page content data , (everything that's not tiny pieces of data) in static files - without having knowledge build assumption upon.

  • what better solution? minimum data in databases, or as can find ways store in them effectively?
  • is there performance difference between use of static files , databases?
  • would best solution depend on general site traffic?

i intend use combination of php , mysql.

if want able search specific data based on several parameters, need use database. sql language namely offers where clause this. whenever data created , updated, database best choice, because provides constraints ensure uniqueness of data degree. relations between data best managed database (using foreign keys , on).

for example user profile best stored in database. user-controlled input must stored in database. server-side include/template files on other hand best stored normal files in server's local disk file system, because there's no need search in it. can eventually store filenames in database if want "link" them more (meta)information (e.g. menu/submenu). same applies binary files (images, downloads, etc), don't want have them in database, unless want (extremely) high degree of portability.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -