473,394 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Relatively simple question. Help greatly appreciated :-)

Hi everyone,

I have a question about how data is stored and persisted in a realworld
application. I am currrently making an email client, newsreader and RSS
Agregator application. I'm just using this as a practice application to
learn some new skills.

My question(s) concerns what I should do to store information. In
particular, the email messages, and news group posts etc.

To focus on the email that will need to be stored - I'm wondering about how
applications like Outlook would store this information.

I was wondering -

1. What data structure do you suppose I should use for internal storage? I
don't have a lot of knowledge about how effective the structures would be in
this sort of scenario.
2. What mechanism of persistence should I use? Again, I don't know too much
about this. I was thinking about binary serialisation. Or maybe outputting
the folders and email messages as XML?

Any advice about what I should do would be great.

One other thing I was wondering about was - how do you suppose an
application like Outlook loads its messages? I mean, do you think it loads
all the messages into memory at startup? That could be quite inefficient.
Perhaps it loads a key of some sort that identifies a message still stored
on the hard disk?

I'm just thinking how to get a balance between carrying out actions quickly,
and not using copius amounts of memory. Bearing in mind that some people can
have hundreds of messages in tens of folders.

I'd really appreciate some advice on the sort of approach I should take

Thanks Everyone!

Simon
Jul 21 '05 #1
2 1201
How I would probably do it (and I'm working on an app with similar data, and
I am doing it this way), is to store the header information (from, to, date,
time, etc) in one place, and the actual body of the text separately, with
indexes in the header information to where the body can be found.

This doesn't necessarily have to mean two separate files, but for
simplicity, that would be the best approach, I think.

You could then load all the header information on startup. Sort the e-mails,
etc, but only pull up the actual text on demand.

Hope this helps.

Pete

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi everyone,

I have a question about how data is stored and persisted in a realworld
application. I am currrently making an email client, newsreader and RSS
Agregator application. I'm just using this as a practice application to
learn some new skills.

My question(s) concerns what I should do to store information. In
particular, the email messages, and news group posts etc.

To focus on the email that will need to be stored - I'm wondering about how applications like Outlook would store this information.

I was wondering -

1. What data structure do you suppose I should use for internal storage? I
don't have a lot of knowledge about how effective the structures would be in this sort of scenario.
2. What mechanism of persistence should I use? Again, I don't know too much about this. I was thinking about binary serialisation. Or maybe outputting
the folders and email messages as XML?

Any advice about what I should do would be great.

One other thing I was wondering about was - how do you suppose an
application like Outlook loads its messages? I mean, do you think it loads
all the messages into memory at startup? That could be quite inefficient.
Perhaps it loads a key of some sort that identifies a message still stored
on the hard disk?

I'm just thinking how to get a balance between carrying out actions quickly, and not using copius amounts of memory. Bearing in mind that some people can have hundreds of messages in tens of folders.

I'd really appreciate some advice on the sort of approach I should take

Thanks Everyone!

Simon

Jul 21 '05 #2
Hi Pete,

Thats a great help. I was begining to think more and more along those lines
as well.

I am still stuck on a couple of thngs though:

1. What sort of data structure do you think I should use for the header
objects that I'll create.

2. Do you have any suggestions what I should use as a 'primary key' - to
identify messages uniquely. I'm thinking I would need some sort of key to
index each message. I'm not sure what I could use to make the key unique
though.

3. What sort of file format should I use for persistence? If I use a header
file in memory, it will somehow have to point to a message on the disk
drive. Do you have any suggestions as to what I could use to store the email
messages on the disk drive. I'm not really sure what my options are in this
respect.

I guess we have serialization of a 'Message' object as binary data. Or maybe
XML. But then I'm just trying to think how this would work in terms of
accessing the messages at runtime as they are stored on the disk.

Thanks again for your help. I really appreciate it.

Take Care

Simon
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: actuary77 | last post by:
I am trying to write simple recursive function to build a list: def rec(n,alist=): _nl=alist print n,_nl if n == 0: print n,_nl return _nl else:
6
by: chonkme | last post by:
Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name....
4
by: PCL | last post by:
I am new to asp.net and am having a hard time with what i would usually do with a recordset. I have a simple query that returns a record - how can i get that record value into a variable after i...
13
by: Jason Swett | last post by:
I want to do graphics with C++. Surprisingly, so far nobody has been able to tell me anything helpful. How do I do it? Any input would be greatly appreciated. Jason
7
by: Master of C++ | last post by:
Hello Folks, I have a programming dilemma with templates and "genericity". I can think of a few solutions, but I am not sure which one is the best in terms of genetic C++ style. Any suggestions...
2
by: Simon Harvey | last post by:
Hi everyone, I have a question about how data is stored and persisted in a realworld application. I am currrently making an email client, newsreader and RSS Agregator application. I'm just using...
1
by: tom | last post by:
Hi, I am a newbie and have a simple question? I have a aspx file and on the form I have a user control which is my header and has some images. Now for various pages I need to load different...
2
by: runway27 | last post by:
i am helping a friend to build a forum website which uses php and mysql database. i am working on the registeration page for the forum website and its validation. i am using php 5.2.5 i am able to...
5
by: BURL ives | last post by:
I am well versed in MS Access. I now want to set up a SQL database on my company's server. However there are some pretty basic questions that I have starting out...I did a bit of searching but...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.