tiddlyserver vs nodejs TW5

423 views
Skip to first unread message

Dave

unread,
Sep 19, 2017, 3:41:57 PM9/19/17
to TiddlyWiki
What are the main differences between tiddlyserver and "regular" nodejs TW5?

Is one easier to set up (e.g. for computer non-professionals)? 
Is one easier to maintain? 
Is one better for one type of use vs another use case? 
Is one more future-proof than the other?
Is one faster responding during normal use than the other?


Here's an example use case: 

Have one master TW5 instance that can switch between folders and access thousands of different sets of TW data (e.g. customer files), possibly accessing different clients in different browser tabs, and ideally, being able to search and analyse data from several clients at once for analysing data patterns amoung all or certain subgroups.


Thanks!
- Dave

Mark S.

unread,
Sep 19, 2017, 4:32:54 PM9/19/17
to TiddlyWiki
Hello,

My observations (YMMV):

1. Tiddlyserver is easier to set up because you can just drop some files into a folder, configure a file, and go.
2. The maintenance would be if something goes wrong. Probably about the same
3. TiddlyServer can serve up Individual TW's as well as TW's based on separate tiddler files. So it's definitely better if your main concern is single TW files.
4. Node.js is probably slightly more future safe since it's not dependent on a single individual. Somewhat irrelevant since you could always switch.
5. Performance is probably the same, depending more on whether you serve up single TW files or TW's that are based on multiple tiddlers.

Only TiddlyServer (TS) can allow you to view external images and pdfs on relative pathways. Only TS can allow you to have multiple tabs, each with a different TW file, all on the same port number.

I was not able to use TiddlyServer for shadow tiddler development in a GIT repository. I had to launch from node.js using special syntax.

Summary: TS is better for most people in most cases. Node is necessary for certain kinds of github-related development.

I'm not sure I understand the details of your use case.

Good luck,

Mark

RichardWilliamSmith

unread,
Sep 19, 2017, 5:29:09 PM9/19/17
to TiddlyWiki
Just so you're clear on the distinction - Tiddlyserver is using the Node server to do what  it's doing, along with some clever stuff that Arlen added. So it's a superset. The main advantages are that you can use it with single file wikis and you only need to run one process.

Dave

unread,
Sep 19, 2017, 5:37:46 PM9/19/17
to TiddlyWiki
Thank you both, that's very helpful.

Clarifying question:

Is it possible to 
A) have a single "front end" TW5 (whether a single file or multiple - I'm still a little foggy on how this works) that can "look up" a client from all the subdirectories, and load that, save all the changes to that client's info in the subdirectory, then search for the next client's name to load that...
or
B) would I be required to have each client be a separate self contained TW?

the reason being, if I want to make changes in how the front end TW does stuff with the client's content, in the case of A), I'd just have to do it once, but in B) I'd have to change each TW file.

Thanks again

Arlen Beiler

unread,
Sep 19, 2017, 10:53:45 PM9/19/17
to TiddlyWiki
First, how are they the same? 
  • They both run in NodeJS. 
  • They both mount "TiddlyWiki Folders" allowing you to edit the tiddlers stored in that data folder.
  • They both support Basic Auth.
How are they different? The "regular" NodeJS TW5 server loads a data folder on startup and serves the browser a dynamically generated single-file TiddlyWiki at its root (e.g. http://localhost/). The browser saves changes to individual tiddlers back to the server via a simple API. This drastically cuts down on the size of the upload when saving changes and is especially good for serving and editing over the internet (if you trust its basic auth AND are using SSL). However there is no way to access any static files on the server. And if you want to serve more than one data folder at a time, you need to start a new instance manually with a different port number.

TiddlyServer is a simple file server that just serves static files as it finds them, mimicing the way Apache serves a directory index. When the user clicks on a regular NodeJS TW5 data folder (which is any folder with a "tiddlywiki.json" file in it), however, it mounts an instance of the regular TW5 server at that path (http://localhost/folder/mydatafolder). All requests starting with that data folder path are then routed to that instance of the TW5 server. 

There are several advantages to this approach:
  • You can have multiple data folders served from one server, each with their own path.
  • You can put static files beside them and link directly to them using relative links. 
  • You can open those static files directly in your browser (audio, pdfs, videos, etc) if your browser supports it.
  • You can put your folder setup on Dropbox or another file syncing system and then sync changes between computers. It works perfectly for syncing one computer at a time. 
  • Static files can save themselves back to the server using a PUT request.
Neither of these work for syncing changes coming from several computers unless you are very careful to completely reload TiddlyServer or NodeJS TW5 after all the changes are downloaded. NodeJS TW5 only loads the tiddlers on startup and then stores them in memory and saves the changes back to disk. TiddlyServer inherits this behaviour, but per data folder, meaning that you can reload individual data folders to get the latest changes from disk (using "?reload=true" on a path). 

Also, neither of them are very safe online. They only use basic auth, so you absolutely have to serve them over HTTPS. A reverse proxy that takes care of authentication first would probably be a better way. So only serve it on networks you trust. Otherwise just serve it on localhost, and you should be good. Both of them should be immune to CSRF attacks, though, as file saving happens using PUT and DELETE. 

I would say they both respond about the same, and one is not more future-proof than the other, except that NodeJS TW5 is the actual core code, and TiddlyServer loads it as a dependency. The code that actually integrates with NodeJS TW5 is about 10 lines, so it should be easy for any TW5 programmer to figure out. 

I hope that explains some things. Thank you, Mark S, for your comments. I can give what I know, but it is good to hear it from someone else as well because you get a different perspective.

Arlen

P.S. I am the one that wrote TiddlyServer (in case you didn't figure that out yet), so that is the perspective I'm coming from. I love to hear other peoples perspectives, though.
Reply all
Reply to author
Forward
0 new messages