Live data from Hacker News

Ask HN: Is it possible to have forum type community running without a database?

news.ycombinator.com

51–60 of 66 posts

Re: Ask HN: Is it possible to have forum type community running without a database?

#51

If the only requirement is to run it on a raspberry pi, and you find that a RDBMS will be too resource intensive, you can always use one of the cloud data storage services out there. Amazon has an RDS offering as part of AWS, MySQL, Postgres, etc. Then your app only needs to talk to the database over the wire with zero local resource consumption by the database.

Wait a minute, not sure I follow. Do you mean that I can run something like one of the forum communities I mentioned on the Raspberry Pi, but then offload all of the grunt work to Amazon? Obviously that would mean that the Raspberry Pi would always need to be connected to the Internet which wouldn't believe much of a problem, but aren't there fairly significant privacy concerns with doing something like that? Or do y…

If offloading things to Amazon is an option, why use a Raspberry Pi at all? Wasn't the sport of it to get it running on a Pi? If it only has to look like it's run on a Raspberry Pi you might as well let it run Nginx as a reverse proxy to a discourse.org forum.

Re: Ask HN: Is it possible to have forum type community running without a database?

#52

I'm a beginner, so forgive me if this is stupid, but consider using Disqus - https://disqus.com/ .

Disqus isn't really appropriate for a forum. It's a simple turnkey commenting system, intended for blogs and whatnot. It doesn't have the capabilities that you'd want for a more involved forum.

Re: Ask HN: Is it possible to have forum type community running without a database?

#53

So I wondered if it is possible to run a forum type community - something along the lines of [elgg][1] or [Friendica][2] - but without the MySQL or other type of database backend? You're attempting to optimize the wrong part of the architecture, I think. A simple read-only query to SQLite or a NoSQL database is fast - generally just a few milliseconds and often less than one millisecond. The odds of you doing it much…

I think this is the best answer right now. Just build your forum the way you would do it normally and aggressively cache.

One addition I would make. Don't cache HTML, cache JSON responses, and build your forum as a one page app. This will allow you to have every response cached while still having customized pages per user (i.e. you could have a user profile on the page that shows a thread).

Re: Ask HN: Is it possible to have forum type community running without a database?

#54

Have a look at 4chan - once the thread is done, it's gone, no need for db for that and the community is still there.

AFAIK sites like 4chan store post data in a database then use that to rebuild the static html files whenever someone posts or deletes.

Re: Ask HN: Is it possible to have forum type community running without a database?

#55

So I wondered if it is possible to run a forum type community - something along the lines of [elgg][1] or [Friendica][2] - but without the MySQL or other type of database backend? You're attempting to optimize the wrong part of the architecture, I think. A simple read-only query to SQLite or a NoSQL database is fast - generally just a few milliseconds and often less than one millisecond. The odds of you doing it much…

Actually there are four hard things: cache invalidation, naming things and off-by-one errors.

I don't know if I've ever seen this joke not answered in this way, gets me everytime though.

Re: Ask HN: Is it possible to have forum type community running without a database?

#56
The first forum software I wrote way back in 1998 didn't use a db.

Basically I just marked up the html file with some data to tell me where the posts were and then when someone would post a new comment the perl script would just insert it into the html.

Serving the forum was just pulling the html files from the disk.

Re: Ask HN: Is it possible to have forum type community running without a database?

#57
post #56

The first forum software I wrote way back in 1998 didn't use a db. Basically I just marked up the html file with some data to tell me where the posts were and then when someone would post a new comment the perl script would just insert it into the html. Serving the forum was just pulling the html files from the disk.

I assume that you just handled the concurrent write situation with a file lock?

Re: Ask HN: Is it possible to have forum type community running without a database?

#58
Once upon a time, when I was playing around with Perl on Tripod, I wrote a very very basic forum with a flat-file "database". Essentially each "post" was a single delimiter-separated line (yes - posts were oneliners because everything was done through GET queries and I didn't know any better) in a text file holding an id, parent id and the post content.

As an actual implementation, of course, it was horrifying and terrible but it's quite possible. I think the forum script from Matt's Script Archive (which still exists) basically edited the html thread files directly, and didn't use a database connection either.

Re: Ask HN: Is it possible to have forum type community running without a database?

#59
Long time ago (~7 years ago, while at high-school), I have used pm-wiki[1] for a small lab-team (~10 ish people) to collaborate on our research projects :-) We eventually moved to tarballs and emails, but wiki was really easy to setup, had a lot of plugins and didn't require a database (all data are plaintext). Maybe it would suit you.

[1] http://www.pmwiki.org/

Re: Ask HN: Is it possible to have forum type community running without a database?

#60
post #58

Once upon a time, when I was playing around with Perl on Tripod, I wrote a very very basic forum with a flat-file "database". Essentially each "post" was a single delimiter-separated line (yes - posts were oneliners because everything was done through GET queries and I didn't know any better) in a text file holding an id, parent id and the post content. As an actual implementation, of course, it was horrifying and te…

You are correct about the Matt's Script Archive forum. I ran a few 10,000+ message forums back in the late 90's that were based off it. They ran mostly without any issues and only occasionally you would find a parent node's tree was not saved correctly and truncated. In most cases this could be manually repaired.

The biggest issue was archiving as the main file would need to be manually edited to remove older threads.

I had moved on to other things by the time phpBB was released.

Post reply on HN