So I am building an application to integrate email into a custom CRM with php/mysql and am wondering what approach to take. I have two options. The first does everything on one process. The second splits it in 2 seperate processes or services.
I am thinking of either
A single service that parses email contents directly into the live database.
1. reading the email.
2. Grabbing the Contents that I want.
3. Storing the contents that I want to the CRM database.
4. Deleting the Email.
OPTION II (two services)
Step 1. reads the email.
Step 2. storing the entire email in an intermediary database table.
Step 3. Deleting the email
Step 1. Loop through the the intermediary table 1 record at a time and parse the contents I want from a single field.
Step 2. Storing the contents that I want to the live CRM database.
Step 3. If the contents are stored successfully, update a flag in the intermediary table as processed for that record.
Which is a better way to do this and why?