Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

bbs bump ordered index

Name: Anonymous 2014-04-27 10:21

I'm making a BBS thing without using sql and I'm wondering what's the best way to save the bump order
I'm thinking of having a array-like index that each line has the thread-id but if someone bumps the last thread it has to move everything one line down and insert the last line into the first line
do you have any other way to save the index? how does shiichan/tablecat/non-sql forums/4chan do it?

Name: Anonymous 2014-04-27 10:49

Tablecat has an index page that it builds every time a post is made. The page you see on the front page of this board is actually a static page. Nothing is executed when you access the board's front page, the static html is simply served. If I make changes to the board files manually, I need to run the "Rebuild index pages" function from the admin side for it to be reflected on the board's front page / in the thread list.

4chan uses SQL, so does shiichan. I don't know about any other textboards other than tablecat that don't use SQL.

There are ways to make an structured index file such that you don't have to rewrite the entire file if an old thread is bumped, by just having fixed size lines and the ability to handle ``gaps'' in the list, but I don't know if it's really worth the implementation complexity.

Name: Anonymous 2014-04-27 11:01

>>2 I'm pretty sure kareha uses delicious flat files as well.

Name: Anonymous 2014-04-27 12:22

any tips of delicious flat file based web app programming

Name: Anonymous 2014-04-27 12:36

shiichan is delicious flat files, one per thread

Name: Anonymous 2014-04-27 12:36

>>5
the question is about the indexing

Name: Anonymous 2014-04-27 12:52

>>6
It's been forever since I've used it, but isn't it just subject.txt? There's no SQL.

Name: Anonymous 2014-04-27 12:59

>>6
4chan uses SQL, so does shiichan. I don't know about any other textboards other than tablecat that don't use SQL.
That's all I was replying to.

Name: Anonymous 2014-04-27 13:33

>>8
okay, I was thinking something else
forgive me

Name: Anonymous 2014-04-27 20:47

If you're using flat files, I suppose you could use a linked list type structure where each thread record contains fields with the IDs of the next and previous threads. That way every time a post is made you can just append and update the head pointer of the last thread. You could use a single file index with fixed size records and thread index IDs or use a maildir like arrangement where each thread is just a directory with symlinks for the next and previous threads.

IANADBA but if you're using a database I'd imagine most SQL databases would make it easy just order threads by timestamp and take the top n threads to generate the front page without the performance being horrible.

Name: Anonymous 2014-04-28 11:23

operations to support

* Go to any thread by key
* get a chunk of threads in order by last bump time
* order of last bump time is maintained unless a thread is bumped, in which case it is moved to the front of the list

so is there a data structure that provides:
* random access
* moving an element to the front

very quickly?

Name: Anonymous 2014-04-28 16:06

>>11
Heap?

Name: Anonymous 2014-04-28 19:24

>>12
*Random access in sorted order, I should have said.

I would either go with a tree or use an array and settle for the shuffle swap. Most threads that are bumped are already near the top, so the array shuffling isn't that much on average. But then you could be ddosed with necro spam.

Name: Anonymous 2014-04-28 20:08

I would go with array too
What kind of tree would you select?

Name: Anonymous 2014-04-28 20:19

>>13
Heap

Name: Anonymous 2014-04-28 23:19

>>14
Walnut

Name: Anonymous 2014-04-28 23:39

>>15 heap maintains a partially ordered set, and the list pages are totally ordered, so yeah...

>>14 btree I guess, since it would be in a database...

Name: Anonymous 2014-05-27 23:53

Wait.. is shiichan sql or flat files?

Name: Anonymous 2014-05-28 0:00

>>18
Delicious flat SQL.

Name: Anonymous 2014-05-28 20:47

What is your adversity to using a database? Why are you trying to make things harder for yourself?

Name: Anonymous 2014-05-28 20:49

What is your adversity to using a filesystem? Why are you trying to make things harder for yourself?

Name: Anonymous 2014-05-28 21:01

>>20
Isn't a file system a form of nosql db after all?

Name: Anonymous 2014-05-28 21:41

>>21-22
Databases use filesystems.

Name: Anonymous 2014-05-28 21:45

>>23
Some filesystems use databases

Name: Anonymous 2014-05-28 21:47

>>23
nnnnn-not necessarily!

Name: Anonymous 2014-05-28 21:47

What's the point of using databases if you can use filesystems? I honestly don't understand.

Name: Anonymous 2014-05-28 21:52

>>26
Because you're a nigger, go fuck a watermelon.

Name: Anonymous 2014-05-28 22:03

honestly filesystems are better than databases and more easy to handle

Name: Anonymous 2014-05-28 22:09

>>28
You can use a filesystem as a database. You can also use cardboard to build a skylift. Depending on the demands of the skylift, you may run into problems.

Name: Anonymous 2014-05-28 22:20

Remember when microsoft was going to make a relational db filesystem? This thread is giving me the same feeling.

Name: Anonymous 2014-05-28 22:21

>>29
most file systems have all the things that needed in a database and it's really easy to use, one way is to use it as a key-value database (file path + name = key, file = value) and having hard/solf links for many keys with one value
with file systems like the apple's one you can do even more things

Name: Anonymous 2014-05-28 22:27

>>31
The space overhead wouldn't be acceptable. Too many tiny files floating around. It's not designed for this.

Name: Anonymous 2014-05-28 23:36

Don't you get fast insert on arrays if you use the array upside down?

Name: Anonymous 2014-05-28 23:43

Cost is one element of memory, maybe two..? So you'll need to clean up every so many inserts. And probably keep an index of the elements to clear. =)

Name: Anonymous 2014-05-29 0:00

I wait eagerly for lukeDB

Name: That feel when no deaf qt gf 2014-05-29 0:03

pls recommend rest framework

Name: Anonymous 2014-05-29 4:45

>>32
hards links are not files and in most cases they have very little overhead

>>36
That feel when no deaf qt gf
Do you want a blind gf who can't speak?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List