0

What is the best way to import data like contacts from other app into our app? Basically the scenario is, we have an app for which the data comes from a CRM. As such we want that whenever a new user registers into our app we must start importing the the user's data from the CRM into our app.

Now this process must not be a blocking process i.e the user must be able to use the app without the importing process interfering in between.

When the import is complete the user must be notified that the import is complete.

The critical part to be resolved here is that the number of users registering is very high and at a good frequency and the number of records to be imported would be atleast in few thousands.

Cron is a definite answer for this, but how?

nilay
  • 1

1 Answers1

0

You really can implement this with Gearman. In this case you need to create worker which contains the logic of importing. And when user will registered in the system you have to create a gearman-task for importing data.

Actually you will have a few steps:

  1. User register
  2. Create task for importing data (f.e. GearmanClient::addTask())
  3. Read the notify from queue, about import complete (you can use RabbitMQ or ZeroMQ)
  4. Show success message to user

Of course you need to run a large number of workers, if your system has a lot of new users.

Kirill Zorin
  • 239
  • 1
  • 5