Jump to content
xisto Community
KansukeKojima

Flat Files! Good Or Bad? Whats Your Opinion!

Flat files!  

15 members have voted

You do not have permission to vote in this poll, or see the poll results. Please sign in or register to vote in this poll.

Recommended Posts

So... whats your opinion on flat-file websites? You know, no databases, everything is stored in txt, php, or html documents...In my opinion I really like using them. This is mainly because I have yet to learn anything about databases :)Post any advantages or disadvantages you think they possess....I like them because, for me, they are fairly easy to use once created. A disadvantage in my opinion is that it takes a while to code properly so it functions well.

Share this post


Link to post
Share on other sites

Flat files are only really good for lists, and not a lot else. Like you say, coding them to act as databases, even in a very primitive way, takes time and effort to get right. Personally I would use a database such as SQLite for anything small scale that requires anything more than a list of single word terms to be stored.Once you learn how to effectively use databases there are all sorts of SQL commands and the like that you can use to simplify a variety of things you would usually have to code manually if you used flat files.

Share this post


Link to post
Share on other sites

When I make my webpages I use a flat file system only because I have no need for a database; however, I did have to create a PHP program to store emails and send period emails out to them. I would have much preferred to use a database system such as mySQL; however, I was not in control of the server and had no idea what was on it other than php and the admin never used mySQL before so I decided to use a flat-file system. So it is good when you can't use a database system; however, I know my code will begin to break down after awhile when the email list becomes too crowded. Flat-file systems are also harmful if you don't secure your code enough and someone decides to inject malicious code into the system and manages to destroy your site with it, but you can even have this problem with a regular database too.So, like I said before, I would prefer to make a mySQL database, but I have no experience in it so I stick with flat-file systems until I need to move over.

Share this post


Link to post
Share on other sites

I dont use flat files well files on their own just to hold data. Although I do keep a few arrays stored in a PHP file just to use it may be considered the same thing. There is an advantage here since its in a PHP file there is no wait time for retriving it from a database. If you have static data that seldom changes and is required often by many processes having this setup will be more effect then having them stored in a database. If on the other hand you have to update it often then flat files are very bad as its much slower to update because the program will have to read each line untill it finds the correct entry then perform the update. If the list gets very long it can be very slow. In this case a database is more effective.

Share this post


Link to post
Share on other sites

It's a lot better to use a database if there are going to be a lot of people trying to change something at the same time. Like, if mySpace used flat files for everything, it would either end up going really slow, or it would just crash, and have a bunch of errors in all the files, because of people trying to change stuff at the same time. If you use a database, it usually has a built in way to protect against anything like that happening.Once you learn how to use SQL, it's a lot easier, and more efficient than flat files, unless you're not going to have many people on your site. It mostly depends on traffic, and the type of data you're trying to store.

Share this post


Link to post
Share on other sites

As noted above, Databases are definitely the right approach to take for many (most) data storage techniques. They handle more users, more data, faster and more securely. No doubt about that. Site membership lists, download lists, and many more applications similar in nature are best handled via a Database Management system.

On the other hand, Flat Files can work quite nicely for applications which are not large, or data intensive, or are static and the security of data is not an issue. Site menus, static lists might be handled by Flat Files where either a Database /system is not available, or is restricted in volume, or if the amount of data is small, so the overhead of a database is not required.

Additionally, Flat Files are a nice, easy way to learn a scripting language without the burden of having to learn the Database System at the same time. Focus on learning the scripting language first and then the DBMS.

Besides, by working with sequential Flat Files first, you will then also know the 'old-fashioned' methods and will appreciate the DBMS more... :P

Share this post


Link to post
Share on other sites

I currently prefer flat files, actually. I've been messing with both CMS's and flat files, and I just find it much better for me. I cannot stand Mysql, and on my sites there is no need to log in. Only for the forums.First of all, I've never heard of the term "flat files," so yet again Xisto teaches me something, :).Second of all, do you think it would be possible to upgrade a 'flat file' site to a CMS?At the moment there is no use for a CMS but in the future I may need a login or something(maybe Membership based site). This probably won't happen, so it's not a big *need*, it's just something to keep in mind.Thanks.

Share this post


Link to post
Share on other sites

First of all, I've never heard of the term "flat files," so yet again Xisto teaches me something, :P.
Second of all, do you think it would be possible to upgrade a 'flat file' site to a CMS?

My website runs off of a flat-file CMS i made specifically for my site. Some discussion in this topic talks about that an actual database requires less work when coding a script to work with a database, is more secure, and is not prone to multiple-edition errors. I will say that that is not always the case, if at all. In my case, my flat-file CMS has not only allowed me to perform less management for my site than what i would have to normally have done if i had gone with a website that requires a database, but compared to the database CMS i have been working on (found in my signature), has a significantly smaller filesize than my database-based CMS. To emphasize a key advantage for my personal, flat-file CMS over a database-based CMS is that in order for my site to list the file i created, all i have to do is upload it into a folder that my script is told to scan in (which does not require to have any of my files to have write permissions). Database-based CMSs do similar but in their own way, but, as for my case, would not allow mass page-creation outside of a database restoration. From my experience it requires more work for a database-based CMS than a flat-file CMS, since there are less security concerns to worry about, and less files to perform different database-accessing tasks (whether it be for user login, page creation, page editing, etc).

Share this post


Link to post
Share on other sites

Is it possible to use flat files for a type of forums as well? I think that it's how Craigslist has theirs set up, for example.I hate mysql with a passion. It often is slowed, there are database errors, etc. It's probably just my lack of knowledge about it, but still, if it can be done using html it would be best(especially for search engine optimization!)

Share this post


Link to post
Share on other sites

Is it possible to use flat files for a type of forums as well? I think that it's how Craigslist has theirs set up, for example.

I've seen flat-file guestbooks before, but i'm not entirely sure how they get around certain security implications. There are also popular flat-file CMSs out there. If you examine their ways, you could eventually come up with a theory on how to build a flat-file forum. I'm not sure if Craig's List uses a flat-file forum, but if so, then i'm impressed. I haven't attempted to do any flat-file based scripts outside of CMS, shoutbox and image gallery, but a forum with multiple users that is flat-file based and secure would be interesting to see. I know you can place files outside of your public_html folder to access things from there, making certain things secure, but i haven't tested working with a script that creates everything outside of your public_html folder. I would assume that would be your best bet, though.

Share this post


Link to post
Share on other sites

Flat files are useful to the extent you want to save the disk space to store them. But when it comes to the applications and abstracting out the useful information from the pile of lot of data it becomes too primitive and cumbersome. So for modern applications where disk space is not a problem flat files become not so useful. Besides these can not be used for purposes on which most of information storage is done. So if you are a beginner it is ok, but for advanced usage you need to rely on the systematic storage of the data.

Share this post


Link to post
Share on other sites

Well I was going to take the flat file route but after all of the thought I finally decided to fully dwelve into the CMS field.Now my view on flat files...I love them when it comes to un-changing information. For example a website about your hobby or something that you really won't change.But if you have a site that will be changing, having information added, etc. I would suggest steering clear and just going with a CMS.

Share this post


Link to post
Share on other sites

Flat files are great for certain kinds of data. For example, I have some large XML (gzipped) files that my web application uses to get tagged, meaningful data from. However, the site also uses a database to store user information and other data. Since the XML files only change about once a year (if that), there is no real problem keeping them like that. However, with too many files, it is possible with a large site to hit the inode limit, disallowing you from making more files on the system. Also, databases do have a lot of useful features that can't be had from flat files (exploiting relationships between data for selection, for example).So, each have their own uses, but, overall, I'd have to go with a database over flat files.Regards,z.

Share this post


Link to post
Share on other sites

I think that flat file cms are not famous and well known. So if few users contribute on flat file based cms no user improvements will occur over time. I always liked databases and prefer Mysql. I am quite used to mysql queries. But maybe flat file cms take little size and bandwidth.

Share this post


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

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.