E
E
elenapetrova19952021-02-12 16:08:48
PHP
elenapetrova1995, 2021-02-12 16:08:48

How to properly process and add to the database?

Hello!
There is a task to connect via API to a certain service once a day and get json from it that needs to be processed and added to the database. Considering that a lot of data will be executed, all this will take a long time.

How would it be more correct to do all this so that the server does not fall let's say?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2021-02-12
@elenapetrova1995

split the task into several simple ones and perform it step by step:
1. loading data
2. parsing and generating intermediate data
3. loading into the database
, you need to create a task queue script run via cron.
if the task is formed by the user, then you can do the same - a "long" controller launched via ajax

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question