blob
blob

Reputation:

Should I store emails in a DB or in a text file?

I need to store email address from a simple form (like a newsletter), but the website loading is high, I'm then wondering if I'd rather store them to a text file (eventually write a cronjob to store them each night to the DB), or store them directly to the DB ?

Upvotes: 2

Views: 344

Answers (2)

Filip P.
Filip P.

Reputation:

Appending them to a text file will speed up things during the 'store' fase. It all depends however what you are going to use the adresses for. If you can use them in a sequential way too, I would suggest the text file.

If, on the other hand, you will use the adresses in a more punctual way, and if you have a performant database at hand, I think storing them directly in the database will be more usefull.

Upvotes: 0

rslite
rslite

Reputation: 84763

I think storing directly in DB would be the fastest way to do it and it will allow for the most flexibility later on. To write in a file you need to deal with concurency and file locking and I don't think the performance gain would be worth the trouble.

Upvotes: 6

Related Questions