views:

188

answers:

8

Hi, This is a general programming question.

What is the best way to make a light blogging system that can handle images, bbcode-ish styling and text without a database back end? Light means not more than 50 to 100 posts in extreme cases. What language(s) should be used? Is there any preferred data format for the information? How does security play out?

EDIT: Client has no database, is on a shared server. Can't change that. Therefore, no DB.

EDIT2:

Someone mentioned SQL Compact - does that require anything more than copying files to the server? The key here is again that things shouldn't require any more permissions than FTP Acess.

+1  A: 

search for flat-file cms-es on google, for example: http://www.flatcms.org/

this has been already done, so there is no need to create such CMS again. there are plenty of them.

dusoft
A: 

I concur with dusoft that this has already been done.

DotNetBlogEngine.net is an ASP.NET (C#) based blogging system that has a nice XML back-end as an option.

Clarence Klopfstein
+8  A: 

If you're looking to do it yourself; store each post as a file in a directory. Then to sort and limit the posts you rely partially on the file names to order and limit them, and potentially (in the case of a search) on reading every last file. Don't go letting users make 10,000 posts though. But yeah, the above is considered a flat file data format. You can get fancy by using a standard format like JSON, Yaml, or XML within each post file, and even fancier by requesting these with Ajax calls in mostly client side code.

Now if the reason you want to work with flat files is that you just don't want to install a database server, there's nothing stopping you from reading a local (to the server) file as a berkley DB, a Lucene Index, or an SQLite DB from within your webapp using the appropriate client library. You'll find any of these approaches a little more sane (a bit faster, a bit more readable in code) than the afore-mentioned with all the same requirements for installing on the server (read-write file permissions). Many web frameworks or languages (like php) come with the option of an API to these client libraries; SQLite, and Lucy (C Lucene) particularly.

If you're just looking for examples of it being done, I first (I think 1999 or 2000) came across blosxom which is a perl script that either runs as a cgi script per request or as a cron job. It builds a dated index of "posts" based on whatever you throw into the directory it's meant to scan. It also builds an RSS feed.

dlamblin
+1, in particular, for suggesting embedded databases as a lower-scale solution
Rob
+1, and I think it's worth adding that many off-the-shelf blogging engines can support embedded databases. There's no sense at all in reinventing this wheel.
Aaronaught
+1 for SQLite, sounds like a perfect answer.
Blair McMillan
+1  A: 

I'm going to go out on a limb here and say that it's not always the destination, but the Journey.

If you're going to set out to do this, I recommend using a language you are comfortable. Personally, this would be C#/.net for me, but from your tagging, I'll assume PHP would be the Serverside scripting language you would choose.

I would layout how I wanted my application to behave. If there is going to be a lot of data, you should consider (as dlamblin mentioned) an DB of some sort for lookup and retrieval. (Light Blog, not so much data... 1000 users can edit? maybe you should consider a DB.) Once you've decided how to store the data, decide how to present it.

Write some proof of concept code for each of the features you want to implement (blog templating, bbcode, user authentication, text searching...) and start to work them all together.

fauxtrot
Thanks, actually this is for clients of mine. 1-3 editors at most and infrequent to semi frequent posts. 1000 users is a *major* overstatement. Yes, PHP is the language of choice here.
Moshe
A: 

Doesn't answer your question directly but check Unify.

Alix Axel
A: 

If you do not want to write a new one or want to get some inspiration:

Hippo
DB Free wordpress - sounds impressive. i've been inspired already.
Moshe
A: 

Jekyll or Blogofile are my favorite kind of solution for that, "compiling pages before upload".

Nikkau
A: 

You could either use XML, or use SQL compact (which allows for handling things just like SQL Server, but instead of a database you utilize flat files).

Andrew