You are here: Re: Suggestion needed on data storage format in text file « PHP Programming Language « IT news, forums, messages
Re: Suggestion needed on data storage format in text file

Posted by Manish on 12/17/64 11:53

>I don't wish to sound offensive, but if you can't correctly write to an
>XML file without errors, why do you think you'll be able to do it to a
>flat file using functions/methods you don't know?

>Also, bear in mind if you use a database it will also handle locking from
>multiple processes easily, which you will have to handle yourself in this situation.

>Don't think "we'll only have one user accessing their account through a
>single web instance so we won't have concurrency issues" - people these
>days may use browser tabs to work on their mail concurrently.

>And you really do run the risk of data loss/corruption if you don't
>correctly lock access to the file.

It's definitely a serious issue. Opening same files concurrently, for
each tabbed browser and then update the content of index file will be
less effecient.

e.g. There can be >1000 messages, say 2 are unread, user reads 1
message, to update the status from read to unread for that message, we
have to update single byte positin for that message. It's critical from
performance (response to user) point of view. If we do it in database,
it will be much faster.

>If the problem is speed, a flat file isn't going to help you that much more. You'll
>still have to encode and decode the data, no matter which format you use. And
>even if it's faster now, all you're doing is delaying the inevitable. You definitely
>need a database.

>If it were me, I'd go back to them and explain why they need a database.
>But I'm only a consultant...

Surely. We will also suggest for the database.

>XML and any text format is very inefficiency when updates/deletions are
>frequent, as you have to rewrite the file everytime. For a mailbox,
>that's unacceptable since the file size will likely be fairly large. A
>suitable format requires a directory of sort storing the offsets of
>records, so you can quicly seek to the them and modify them in place.

The mailbox file (.mbx) will be there. We will parse it and store only
some of the details (including mailbox file offset for that message) in
the index file. (.idx, .xml, and surely the best will be database)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация