Jump to content

XML-based Web Blog

Rakanoth

I am developing a simple web blog. As a DB system, I want to use XML.

 

How doable is it?

How proper is it?

 

Link to comment
Share on other sites

Link to post
Share on other sites

I think the standard is using a MySQL database, having different XML files for it all would be confusing and inefficient if you got it working

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, NeatSquidYT said:

I think the standard is using a MySQL database, having different XML files for it all would be confusing and inefficient if you got it working

Sure. Relational Databases are standard but could you please elaborate on the point that it would be confusing and inefficient?

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Rakanoth said:

Sure. Relational Databases are standard but could you please elaborate on the point that it would be confusing and inefficient?

With a standard blog, you'd just simply search the item in the database and get all the information like that. With XML you could have a similar thing, but it would be more difficult to add to and remove stuff from because I doubt there'd be as good of an API. Why do you want to use XML?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, NeatSquidYT said:

With a standard blog, you'd just simply search the item in the database and get all the information like that. With XML you could have a similar thing, but it would be more difficult to add to and remove stuff from because I doubt there'd be as good of an API. Why do you want to use XML?

I have never seen blog developed with XML. I want to try it. The main reason could be portability.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Rakanoth said:

I have never seen blog developed with XML. I want to try it. The main reason could be portability.

It would sure be a fun test and I encourage you to try it if you desire, but my concerns would be security and a lack of an API (afaik) without you having to create it yourself

Link to comment
Share on other sites

Link to post
Share on other sites

33 minutes ago, Rakanoth said:

Sure. Relational Databases are standard but could you please elaborate on the point that it would be confusing and inefficient?

its inefficient as when searching you have to read the file line by line until you reach the item you want. reading files are both slow and blocking.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

I would say no. 

 

JSON files would be more flexible and require less parsing than xml : https://www.json.org/ (the pictures and text on that page are all you need to parse json... can't say the same for xml)

 

xml is like good for everything but best at nothing just adding a ton of crap you don't need.

 

Plenty of other CMS (content management systems) use flat files (or even plain text files) to store the content of the blogs, but they all have advantages and disadvantages.

 

A database would be easier to work with at it allows you to implement some things like full text search, caching queries and content in memory easily,... with physical files depending on number of users accessing your blog, size of blog etc you can run into I/O issues etc ..

Link to comment
Share on other sites

Link to post
Share on other sites

Well, there are XML databases in the wild and quite a lot of document-orientated databases. The thing is: you won't gain anything from writing your own database system. It won't be fast, it won't be more efficient, it won't be more secure. Since the data in a Blog is very structured and sticks to a certain data scheme there's no advantage of choosing a NoSQL DBMS like MongoDB over MariaDB, MySQL, PostgreSQL, etc … NoSQL shine if data is not very structured, objects and their data vary and you don't have a lot of relations.

Are you planning on writing your very own blog system with backend, editor and everything? If so: keep in mind that it takes a lot to keep in mind to make it secure. Big CMS like Wordpress, Drupal, Joomla, Typo3 and so an have hundreds if not thousands of people looking over it and spotting bugs and leaks – you won't be able to compensate for that in a short period of time. And there are scientists who are actively looking for leaks too. Keep that in mind. It's a great project for you to learn a thing or two but definitely not a wise decision if its for a serious production environment.

Use the quote function when answering! Mark people directly if you want an answer from them!

Link to comment
Share on other sites

Link to post
Share on other sites

Flat-file storage is actually a more proper way to manage blog posts than using a database like MySQL. Plain text (which is what a blog is made of) is not a "dataset".

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Dat Guy said:

Flat-file storage is actually a more proper way to manage blog posts than using a database like MySQL. Plain text (which is what a blog is made of) is not a "dataset".

That totally depends on how you define a dataset in you're scheme. Each entry in a blog usually consists of more information than just plain text. Like authorship, date of publication, tags, comments, likes etc. If you want to cross-reference various elements a flat file data structure is not suitable. It's doable but not a good choice (imho). Of course, if all you want is to publish text with no regards to tagging, authorship or any user interaction it is a viable way.

Use the quote function when answering! Mark people directly if you want an answer from them!

Link to comment
Share on other sites

Link to post
Share on other sites

47 minutes ago, bowrilla said:

If you want to cross-reference various elements a flat file data structure is not suitable.

GUIDs would be a way.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, Dat Guy said:

GUIDs would be a way.

It sure is possible, I'm not denying that. I was just trying to point out that Blogs usually have more data than just plain text which makes flat file databases not really a good choice. It will work no matter what kind of db your choosing though. 

Use the quote function when answering! Mark people directly if you want an answer from them!

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/29/2018 at 1:27 PM, bowrilla said:

That totally depends on how you define a dataset in you're scheme. Each entry in a blog usually consists of more information than just plain text. Like authorship, date of publication, tags, comments, likes etc. If you want to cross-reference various elements a flat file data structure is not suitable. It's doable but not a good choice (imho). Of course, if all you want is to publish text with no regards to tagging, authorship or any user interaction it is a viable way.

all of which you could define in a flat file system hace a look at https://www.htmly.com/ or https://getgrav.org/

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, vorticalbox said:

all of which you could define in a flat file system hace a look at https://www.htmly.com/ or https://getgrav.org/

I've never said it wouldn't work, I've just pointed out that it's not the best choice for these scenarios. 

Use the quote function when answering! Mark people directly if you want an answer from them!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×