Am Thu,  28 Dec 2023 20:06:42 +0100 schrieb Christoph Berg
 <c...@df7cb.de>:

> Re: Thomas Beierlein
> > Two points here:
> > 
> > - Journaling is easy, but to be honest TLF provides quite some
> >   robustness in that sense too. I have not heard any complies about
> >   lost data in all the years.  
> 
> Some time last year, I was auditing (well, reading) the tlf source to
> check that. There are sync() and fsync() calls in there, so it's
> probably mostly safe, but since calls that write to disk are spread
> over the code, data safety looks quite ad-hoc. If power goes out while
> the log is just being written, I'd bet there will be problems.
> 
> Switching to sqlite would get us crash safety for free since that's a
> library specifically written for that.


Sure, bad things can happen anytime. I just said 'quite robust' and not
'problem free'.

Besides the sync() calls there are some more points to make data losses
unlikely:

- The log is always kept on disk. Only a copy of it is in memory.
- The file is kept closed most of the times and opened only when adding
  a contact or correcting an entry.
- Actual file systems are often using journaling which helps also to
  some degree.

But I agree with you that using a database would make the situation
better. 

73, de Tom DL1JBE

-- 
"Do what is needful!"
Ursula LeGuin: Earthsea
--


Reply via email to