I need an easy Database for my Windows Service
Posted on 2009-04-19
I have a small service which downloads mails, stores them and sends them (IMAP 2 SMTP).
These functions are from my first tests. Fast and dirty. But now I want to design them at all.
I need them to be stored in some kind of files. So the user can move them to an other machine easy.
So I have a email-account with about 3500 mails. Each 20-100k in size.
I download them to the local dir and create two files for each mail.
firstname.lastname@example.org containing the email
email@example.com containing infos about the mail and the handling
I need to delete the mails after 14 days. So I need to know which ones I allready downloaded, which not and which to delete.
For this I use a ini-file.
This file is about 300-400k in size.
Im not sure how clever GetPrivateProfileString or WritePrivateProfileString are.
I have a log file with about 30 - 100 MB per day (textfile).
Old Information will be deleted to save space.
So here we go.
a) how should I save the emails itself?
Everybody told me not to save binary data in a mailbox. But a dir with thousend of small files sounds not very good too.
b) which kind of database to use to stores the other information?
It must be:
- free of chargeto use in a comercial software
- easy to install
- capabil to defrag itself
Because the software will only costs about 50 Euro I cannot tell somebody to buy a MS SQL Server.
Allthough I cannot tell anybody to install MySQL itself.
But how to defrag. I tried to programmly defrag mdb files without success.
Is this possible with mysql?
How to access MySQL from a service?