🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #88110

Re: Header lines

#88110
From: Grant Taylor
Date: Tue, 07 Jan 2020 21:15
55 lines
3558 bytes
On 1/7/20 12:54 PM, Borneq wrote:
> I think about how to store articles in database (especially in Sqlite). 
> I prefer one table record for one article but can be better solutions?

Oy vey.

That question prompts opinionated responses.

I have been burned too many times by various forms of ""database 
corruption with various email / news programs to reach for them.  The 
monolithic (or few files) ever growing has implications for backups too.

I prefer to use a varient of a database that is quite common, most 
people refer to it as a file system.

I'd probably store each article as a discrete file in a directory 
(structure) for each newsgroup.  I'd likely hard link the same file into 
multiple directories when it's cross posted to multiple newsgroups.

You can easily use traditional programs for (de)compressing the files to 
save disk space.

I probably would consider some form of database for some of the 
metadata.  From, Date, Subject, References, etc. headers would be the 
most likely thing to make easier to access than extracting them out of 
each (compressed) file.

I've spent some time pontificating how to do the display and threading. 
  I've not worked out the threading yet.  But I do think that I would 
take the list of articles in the newsgroup and only load the additional 
headers of the subset of the list that are currently being displayed in 
the index of the newsgroup.  Bearing in mind that you will quite likely 
have an index view of the newsgroup with < 100 articles out of a 
newsgroup that could have tens of thousands of articles.  So why take 
time to process the additional fields of the other thousands of messages 
if it's not going to be displayed.  Modern file systems should be 
sufficiently fast enough to fetch the needed fields (from a cache) as 
you scroll.  Admittedly, I might keep the page before and after the 
current page loaded.  Possibly unread messages too as it's likely that 
the reader will jump to them.

But the threading, that is a tough nut to crack.  Most methods (that I'm 
aware of) are recursive or even more specialized.

> I want store body as compressed blob, required header fields as table 
> column fields, but is also variable number not required header fields.

Ya.  The additional header columns tend to be sparse or consume more 
space.  It's a question of what's the best way to optimize.



-- 
Grant. . . .
unix || die
Technical Details
Message-ID: <qv2sak$7f2$1@tncsrv09.home.tnetconsulting.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <5e1486b7$0$511$65785112@news.neostrada.pl> <5e14e1f3$0$558$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
Message-ID: <qv2sak$7f2$1@tncsrv09.home.tnetconsulting.net>
Subject: Re: Header lines
Date: Tue, 7 Jan 2020 14:15:14 -0700
From: Grant Taylor <gtaylor@tnetconsulting.net>
References: <5e1486b7$0$511$65785112@news.neostrada.pl> <5e14e1f3$0$558$65785112@news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: TNet Consulting
Lines: 55
Nntp-Posting-Host: alpha.home.tnetconsulting.net
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: tncsrv09.home.tnetconsulting.net 1578431636 7650 198.18.18.251 (7 Jan 2020 21:13:56 GMT)
X-Complaints-To: newsmaster@tnetconsulting.net
Nntp-Posting-Date: Tue, 7 Jan 2020 21:13:56 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2
In-Reply-To: <5e14e1f3$0$558$65785112@news.neostrada.pl>
Content-Language: en-US