Why doesn't TW use LocalDb

165 views
Skip to first unread message

Henry Padilla

unread,
Jun 11, 2015, 8:18:51 AM6/11/15
to tiddly...@googlegroups.com
I am a developer and one of the guys at work asked me why TW doesn't use local storage (LocalDb) and I couldn't answer him. We were talking about what a pain it is to save files locally now that the browsers have made us"safe" and he suggested local storage. I've not heard of it or it's limitations so I couldn't respond.

Anybody think of any reasons?

Tom P.

PMario

unread,
Jun 11, 2015, 10:03:26 AM6/11/15
to tiddly...@googlegroups.com
Hi Henry,

Just some questions and if you and / or your colleague can answer them, you may know why TW saves to a file. All of those questions can easily answered by every TW user if you replace "local store" with "local file" in the questions below.

 - In which directory on your local HD is the local store that stores the content?
 - How can I backup the local Store?
 - How much content can I store there?
   - Is it different in different browsers?
   - Can I copy it from one browser to an other?
   - Can I send it per mail?
 - Who can access this local store?
 - Can I have different TWs?
 - Which file format is used to store the data?
   - Is it browser dependent?
   - Is it simple text files?
   - What if I want to access that store in 5 / 10 / 15 years from now.
     - Can I read the file format?
     - Can you guarantee, that I can read it?
 - Do I need a server to access the local store?
 - What happens if I clear my browser history for security reasons?
 - What happens if I want to access the same TW with Chrome, FireFox or Safari on the same machine?
   - Is this possible?
 - What if ...

BTW. I don't know the answers to all of those questions for local storage. But I can answer them for local file as it is.

 - In which directory on your local HD is the local file that stores the content?

In every directory you want to save it. Default is most likely the "Downloads" folder, depending on your browser user settings.
 
 - How can I backup the local file ?

Just make a backup, using your standard backup software. Or use the (cloud based) file sync software, that you like.
 
 - How much content can I store there?

How big is your hard disk?
 
   - Is it different in different browsers?

No, it's the same for every software on your machine.
 
   - Can I copy it from one browser to an other?

If you can copy files. Yes.
 
   - Can I send it per mail?

If your peer has an email address and you can send mails. Yes.
 
 - Who can access this local file?

If you directory is protected / encrypted, it's for your eyes only. Access control can be done on OS level.
TW has an encryption mechanism. I have my own thoughts about this mechanism, which we may discuss somewhere else.


 - Can I have different TWs?

As many as you like.
 
 - Which file format is used to store the data?

HTML is a text based file format and it is "human readable". So every standard text editor can read it. Every browser should be able to read it and display it's plain text in the future.

   - Is it browser dependent?

no.
 
   - Is it simple text files?
 
yes
 
   - What if I want to access that store in 5 / 10 / 15 years from now.

If you have a text editor it will be readable.
 
     - Can I read the file format?

The .txt format is very unlikely to change, without breaking the web.
 
     - Can you guarantee, that I can read it?

If the possibility to read electronic media still exists, out of the box, it is more likely to be able to read a .txt / .html file then the local storage file format if you ever find the file.
 
 - Do I need a server to access the local file?

no.
 
 - What happens if I clear my browser history for security reasons?

nothing.
 
 - What happens if I want to access the same TW with Chrome, FireFox or Safari on the same machine?

TW will be loaded from the file, and the browsers display them.
 
   - Is this possible?

yes.
 
have fun!
mario

PMario

unread,
Jun 11, 2015, 10:10:09 AM6/11/15
to tiddly...@googlegroups.com
As a bonus exercise you may replace "local store" with "local browser database" and deal with indexDB, SQLight and what ever framework is used to locally store web page data with different browser engines.

have much more fun!
mario

PMario

unread,
Jun 11, 2015, 10:16:05 AM6/11/15
to tiddly...@googlegroups.com
On Thursday, June 11, 2015 at 4:03:26 PM UTC+2, PMario wrote:
 
 - What happens if I want to access the same TW with Chrome, FireFox or Safari on the same machine?

TW will be loaded from the file, and the browsers display them.

Sorry I forgot IE10+ and Edge. but I didn't use Edge yet, so I don't know. But IE works fine.

mario

PMario

unread,
Jun 11, 2015, 10:27:51 AM6/11/15
to tiddly...@googlegroups.com
On Thursday, June 11, 2015 at 2:18:51 PM UTC+2, Henry Padilla wrote:
We were talking about what a pain it is to save files locally now that the browsers have made us"safe"

If you click the save button, TW uses the default browser save mechanism, which technically works in the same way for every browser.
The problem here is, that different browsers use different default settings, for the following user feedback. eg: Some show the OS file save dialog by default, some don't.

This "fallback mechanism" is inconvenient, because you need to reload the page and browsers automagically rename the saved file instead of overwriting it.
This behaviour is sensible for most web usecases, but it's not what we want for TW. The good thing is, we can change that.

-mario


Henry Padilla

unread,
Jun 11, 2015, 10:54:07 AM6/11/15
to tiddly...@googlegroups.com
I think this is what he is asking. After the initial setup that grants access we wouldn't have the save issues that plague the file version.

It looks like this is a mobility issue. But, for those of us that have to resort to Nodes.js mobility is still an issue.

Is there a version of TW that uses the local browser Db?

Danielo Rodríguez

unread,
Jun 11, 2015, 3:12:09 PM6/11/15
to tiddly...@googlegroups.com

Is there a version of TW that uses the local browser Db?

Yes it is. There is a plugin that adds a sync adaptor that uses local db. I don't remember the repo but it is on tw.com under the community section.

I am also working on a PouchDB adapter. It also saves tiddlers to localdb with the bonus of syncing to a remote couchdb server. It is currently under beta testing.

Regards 

PMario

unread,
Jun 12, 2015, 3:54:55 AM6/12/15
to tiddly...@googlegroups.com
On Thursday, June 11, 2015 at 4:54:07 PM UTC+2, Henry Padilla wrote:
I think this is what he is asking. After the initial setup that grants access we wouldn't have the save issues that plague the file version.

But imo a lot more others. IMO there are no problems with the file version, except multi user access.
 
It looks like this is a mobility issue. But, for those of us that have to resort to Nodes.js mobility is still an issue.

Why do you need node.js? TW works perfectly fine without it. IMO the nodejs server is for testing and local purposes only. If you expose it to the web, it creates more problems, than advantages atm. Not enough security.
 
Is there a version of TW that uses the local browser Db?

Why? You have a lot of cross browser, cross OS problems. IMO browser internal DBs are not up for the task, in the way TW needs it. Local storage was "dead on arrival".
So developers use frameworks on top of them to "hide" the problems. So imo Danielos approach would even fit better.

.... But you didn't tell us about your usecase? Why do you think an internal DB would have advantages. If you look at the details, there is a mine field.

-m

Henry Padilla

unread,
Jul 10, 2015, 4:08:07 PM7/10/15
to tiddly...@googlegroups.com
My usecase is work.

I keep notes on the tasks and bugs I deal with at work. It's not exposed to the web, I don't need cross-platform, I don't even really need security.

What I would like is TW to work without having to click "OK" every time I do something (or ending up with an entirely new html file). So I use Nodes.js.  But now I have a CLI window open constantly.

I would argue that TW does not work "perfectly" fine without some file access support of some kind. It need not be Nodes.js but the browsers simply don't have IO access like they used to.

So, that's what I'm looking for: TW, in Chrome, that saves without me needing to click "OK" or ending up with an entirely new html file, that doesn't leave a CLI window open, that I can move onto a thumb drive (or expose to other devs here at work) if I want.

Tom P.

Jeremy Ruston

unread,
Jul 11, 2015, 10:33:58 AM7/11/15
to TiddlyWikiDev
Hi Henry

I would argue that TW does not work "perfectly" fine without some file access support of some kind. It need not be Nodes.js but the browsers simply don't have IO access like they used to.

Have you tried using TiddlyFox with Firefox? It gives the user experience you describe.

So, that's what I'm looking for: TW, in Chrome, that saves without me needing to click "OK" or ending up with an entirely new html file, that doesn't 
leave a CLI window open, that I can move onto a thumb drive (or expose to other devs here at work) if I want.

If you need to use Chrome you may want to explore Arlen Beiler's new TiddlyChrome extension (see the post in the main TW group).

Best wishes

Jeremy.
 

Tom P.


On Friday, June 12, 2015 at 2:54:55 AM UTC-5, PMario wrote:
On Thursday, June 11, 2015 at 4:54:07 PM UTC+2, Henry Padilla wrote:
I think this is what he is asking. After the initial setup that grants access we wouldn't have the save issues that plague the file version.

But imo a lot more others. IMO there are no problems with the file version, except multi user access.
 
It looks like this is a mobility issue. But, for those of us that have to resort to Nodes.js mobility is still an issue.

Why do you need node.js? TW works perfectly fine without it. IMO the nodejs server is for testing and local purposes only. If you expose it to the web, it creates more problems, than advantages atm. Not enough security.
 
Is there a version of TW that uses the local browser Db?

Why? You have a lot of cross browser, cross OS problems. IMO browser internal DBs are not up for the task, in the way TW needs it. Local storage was "dead on arrival".
So developers use frameworks on top of them to "hide" the problems. So imo Danielos approach would even fit better.

.... But you didn't tell us about your usecase? Why do you think an internal DB would have advantages. If you look at the details, there is a mine field.

-m

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/7a679e27-aead-492d-9117-76063d87a6d7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com
Reply all
Reply to author
Forward
0 new messages