D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Recommendations for a command line only address book for storing basic contact details?

 

On Thu, 1 Apr 2010, Martijn Grooten wrote:

On Thu, Apr 1, 2010 at 2:29 PM, Roland Tarver wrote:
But, I think I will "tinker" with a few
of the commands/formats you mention - just for fun and see what I can
come up with. If nothing else, I'll learn something! haha!

These are IMHO what makes Linux so cool. :-)

I would say that my life -- or at least the part of it where I'm sat
behind a screen -- is made a lot easier by grep, sort, cut, sed and
the likes.

I used to use only text files for all the programming I did, because I
didn't know MySQL. Then I learned that and thought it was the right
way to do things. Now I realise how many things are done faster and
more easily with plain text files.

There's a trade-off between applying a complex search and ease of use - and sometimes it's going to be much faster to read, parse and search a simple text file than to make a database query (although one of these days I'll do some actual benchmarks)

So for example - in my little PBXs which handle up to 250 extensions - I keep the extension data as a simple text file with colon separated fields - I can read this into a PHP program in milliseconds, use it to generate the asterisk configuration files and be done. The SQL equivalent would be to open a connection to the database, send a textual command to the database which then gets parsed, executed and data returned, then I can start to use that data to generate the asterisk config files. No need for an additional bit of bloatware and another point of failure...

Actually, even in the big ones with 1000's of endpoints, I still keep the data in a flat file. It just seems easier..

But for other applications, I have used a command-liny SQL thing - sqlite. It's actually very good, if a little slow. My greylisting database uses it - currently managing a database of 12 million entries... )-:

Gordon

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html