'Best Practice: Save Html code in database, fileserver or repository?

I want to save save Html code from websites with about 500.000 Characters (we will name it Code A). After I save the actual code, I want to check every week, if there are some changes on the website. So I download every week the websites's Html (we will name it Code B) and want to compare Code A (the older one) and Code B (the current code). If there are some changes in Code B to Code A, I want to save the changes.

My Idea: I save the Html code in a SQL Database with this structure:

Timestamp | Html Code | URL | Attribute 1 | Attribute 2 

I will save each website like this and compare it later. But it is not the only on solution and maybe not the best solution. Somebody tells me, that a fileserver or a repository like git is a better solution. But how can I get the changes? In my solution, I do a SQL-query and get the two codes snippes and can compare them. But I think, I need a lot of performance and time, if I call strings with 500.000 characters from the database. Additionally information, I want to do that with more then 1000 differentes websites.

How do you do solve this challenge? Do you have suggestion?

I'm thankful, if you give me a tip.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source