Question

I have been musing over these approaches for quite a while and I was wondering what would be the best way to store textual data for a "blog" style format of a website?

The approaches I have thought about have been:

PHP and Databases

Probably an obvious first thought for must people but I honestly don't know enough of PHP to comprehend safe and secure data transfer to and from the database in the server.

The other option I have thought about is:

Javascript and JSON

This a topic I know a considerably large amount more than I would PHP and Databases but is it really secure enough?

The site:

The site that I am designing is for a small time charity in which I had volunteered to create a website. Since that is done I decided to turn my attention to an admin style page where content writers could create the content. The challenge I am posed with is how to store the data. The site in general is more so a personal space for the charity to tell everyone what they are up to and to have a gallery of images.

Allow me to pose my questions more clearly here:

  • Is Javascript and JSON data secure enough for a "blog" site?
  • Or is PHP and Databases the De Facto ruler of these systems?
Was it helpful?

Solution

Is Javascript and JSON data secure enough for a "blog" site?

Languages and data formats are not intrinsically secure or insecure.

Or is PHP and Databases the De Facto ruler of these systems?

PHP

There are no shortage of programming languages that you could use. PHP is just one of many. It is quite popular. There are other popular languages.

Databases

Databases solve a lot of problems. They let you quickly sort, search and update data without having to worry about race conditions, file locking or anything like that. You can get by without one though.

OTHER TIPS

Javascript and JSON will not allow you to safe the content anywhere. Javascript is great to bring client-side interaction to a webpage. JSON is great for transporting data from A to B. Neither are equipped or particularly well suited to persistently store content anywhere.

PHP is one viable option, but certainly not the only one. There are a lot of other languages out there that are capable to do the same, such as Ruby, Python, or Perl just to name a few. Depending on the platform that your server is running on, ASP.NET might be an option as well. This is all but a limiting list, though. I wouldn't say that the possibilities are endless, but for all intents and purposes they might as well be.

Databases seem like a good candidate, but again, not the only candidate. I've seen blogging systems that use plain text files on the host's file system as their storage "system" - minimalist, elegant, and very flexible.

Then again, you could ask yourself whether you should really try to roll your own blogging system - plenty already exist, most of them freely availabe and more often than not with sundry of themes to pick from, which you could alter to your needs or just use as inspirition/guidance to make your own theme.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top