Are databases always a solution in a web data warehouse?

I have no experience with databases, but I want to study it and use it in the web project that I plan.

Although, I have tips from my friend that the use of databases should be more extensive than I planned. He believes in storing almost all the data in databases, where I find that the databases are most convenient with respect to possibly user data (only tiny pieces of data), as well as page content data and the like (everything thatโ€™s not only very tiny parts of the data) in static files - without any knowledge to create this assumption.

  • What would be the best solution? Minimal data in databases or how much can I find ways to store it efficiently?
  • Is there a performance difference between using static files and databases?
  • Will the best solution depend on the overall traffic of the site?

I intend to use a combination of PHP and MySQL.

+6
performance database php mysql web-traffic
source share
7 answers

If you want to be able to search for specific data based on several parameters, you really need to use a database. The SQL language offers you a WHERE for just that. In addition, whenever data needs to be created and updated, a database is the best choice as it provides limitations to ensure that the data is unique to a certain extent. Also, the relationship between data is best managed by a database (using foreign keys, etc.).

For example, a user profile is best stored in a database. Also, user input must be stored in the database. On the other hand, include / template server files are best stored as regular files in the local file system on the serverโ€™s local disk, because there is no need to look in it. You can ultimately save the file names in the database if you want to โ€œlinkโ€ them with some additional (meta) information (for example, a menu / submenu). The same goes for binary files (images, downloads, etc.), you do not want to have them in the database if you do not want a (extremely) high degree of portability.

+4
source share

Databases are not the only means of permanent data storage, they are simply the most common.

There are document / blogging mechanisms that do not use databases at all. When a page is created, modified or commented on by a static html file, created or modified. For example, Movable Type .

Similarly, you can have pure storage systems in memory, where if the system is turned off, data in memory is simply restored. Or the contents of the memory are flushed and then restored, and no database is involved. This is usually done on systems with extremely high throughput or requires extremely low (microsecond) latency.

Your question cannot be answered, because the answer to everything that you asked is "it depends", and you can probably make it work, but you do it.

I will say this: don't worry about performance until you really have a problem. Most of the performance problems that you encounter are likely to fall into the indexes and primary keys in the database.

PHP and MySQL are great choices.

+3
source share

A database is the right place to store data that is strong data. Flat files simply cannot be indexed at almost the same speed as the data in the database. On the other hand, more training is required to install the database.

Binary data, such as photographs, are not so large in databases.

+2
source share
  • I would say: everything is in the database. Databases are optimized for this kind of thing. Most blogging programs also use content databases, which is safe. Edit: oh, binaries are really better than files. But also MySQL can handle them safely. If you have 1 photo, itโ€™s normal to store it in the database (since it is easier to maintain), but if you have, say, 10,000 photos: use files instead and save the link to the files in the database (their location, etc. .).
  • Absolutely: the databases are optimized again. Under the hood, the database uses files: but you no longer need to do this.
  • The MySQL database is absolutely suitable for general site traffic.

PHP and MySQL are good choices.

0
source share

Also, if data processing requires transactions, databases are almost always the only good solutions.

0
source share

Mysql is one of the common data integrity databases. If you plan on storing big data, mysql is best. Security should also be considered when using a database. Mysql is very safe and easy to use, you can also search the entire network for more detailed documentation and examples.

0
source share

In my opinion, you need a reason not to store data in a database. | But I think you should also consider non-data related databases like google datastore http://code.google.com/appengine/docs/python/datastore/ or other similar things.

0
source share

All Articles