Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What goes into rolling your own wiki using c# and sql?

Tags:

c#

sql

wiki

I'd like to understand how a wiki works, at least from a high level. When a user saves changes, does it always insert a new row in the database for that wiki article (10 revisions, 10 rows in the database).

like image 832
Byron Sommardahl Avatar asked Feb 19 '10 14:02

Byron Sommardahl


2 Answers

I agree with all the answers. Wikis normally handle every edit as a new record inside the database.

You may be interested in checking out the full Layout of the MediaWiki database diagram, the wiki engine behind Wikipedia.

Layout of the MediaWiki database diagram

Note that the full text of each revision is stored in a MEDIUMBLOB field in the text table.

like image 159
Daniel Vassallo Avatar answered Sep 28 '22 16:09

Daniel Vassallo


I just wrote a wiki in C# actually. One thing I would add to everyone else's comments is that you'll want to make sure you can compare two versions. For doing this in C# I strongly suggest the C# implementation of the diff_match_patch library from Google. It's quite fast and it's quite easy to extend if you need more in the way of pretty printing or handling of structured text like HTML.

like image 22
Eric Avatar answered Sep 28 '22 15:09

Eric