/db-email

Experiment to compare the time execution of sending emails without and with applying concurrency in Go

Primary LanguageGo

db-email

Experiment to compare the time execution of sending emails without and with applying concurrency in Go. Stable internet connection is required to run this project.

Stacks

Installation an running

  1. Configure smtp host, port, and other credentials from .env
    cp .env.example .env
    
    Then open .env to:
    • configure EMAIL_DEFAULT_SENDER to your GMail account
    • configure EMAIL_DEFAULT_RECIPIENT to default email destination
    • configure EMAIL_APP_PASSWORD from password that you should already get from Google App Password
    • configure NUM_EMAIL_SEEDS to set how many emails you want to sent to EMAIL_DEFAULT_RECIPIENT.
  2. Run the app with docker. Make sure you have already install Docker and docker compose in your system.
    docker compose up --build
    
  3. Wait for a few seconds. This process will takes more seconds or even minutes depending on your internet connection and NUM_EMAIL_SEEDS that you have been set.
    INFO[0057] successfully send 10 emails and failed to send 0 (total: 10) in 56.745299 seconds without concurrency
    INFO[0071] successfully send 10 emails and failed to send 0 (total: 10) in 13.746935 seconds with concurrency