Ask everyone, my company's current project needs to get the shopping points of members, but the new point query program is built on another platform, I need to get the latest point data through the SOAP interface. However, the speed of batch calling SOAP to query points is greatly limited. Currently querying... ask everyone, my company's current project needs to get the shopping points of members, but the new point query program is built on another platform, I need to get the latest point data through the SOAP interface.
However, the speed of batch calling SOAP to query pointsIt will be severely restricted.
Currently, the new query requirement is to obtain the user information of a certain credit range (the user data is in my own company, and the data table of the other company has not been indexed, each point query uses the join query method to obtain points.... [-_-A little tragic]. Are you sure you want to speed up your queries...
The PHP function that calls SOAP is as follows:
true, 'exceptions' => true)); $request = $connect->__soapCall('getCustomerScore', array(array('custId' => $custId))); $response = json_decode($request->getCustomerScoreResult, true); if (empty($response['error'])) { $score = json_decode($response['scoreList'][0], true); return $score['scoreBalance']; } else { return false; } }
After querying the points, I use the local database to query the basic information of the user, and then use the associated array combination. Currently, it is a little faster ..
However, if the number of queries continues to increase, the query speed will be greatly reduced ..
Reply content:
Ask everyone, my company's current project needs to get the shopping points of members, but the new point query program is built on another platform, I need to get the latest point data through the SOAP interface.However, the speed of batch calling SOAP to query pointsIt will be severely restricted.
Currently, the new query requirement is to obtain the user information of a certain credit range (the user data is in my own company, and the data table of the other company has not been indexed, each point query uses the join query method to obtain points.... [-_-A little tragic]. Are you sure you want to speed up your queries...
The PHP function that calls SOAP is as follows:
true, 'exceptions' => true)); $request = $connect->__soapCall('getCustomerScore', array(array('custId' => $custId))); $response = json_decode($request->getCustomerScoreResult, true); if (empty($response['error'])) { $score = json_decode($response['scoreList'][0], true); return $score['scoreBalance']; } else { return false; } }
After querying the points, I use the local database to query the basic information of the user, and then use the associated array combination. Currently, it is a little faster ..
However, if the number of queries continues to increase, the query speed will be greatly reduced ..
1. I don't know if the SOAP Service provides you with other calling methods. In your example, the corresponding points are queried based on the user, because you need to query the user based on the points segment, if the getCustomerByScore () method is similar to the getmermerbyscore () method, it is more convenient to call it. Your current method is to traverse all users. If you have a method to query user Sets Based on scores, the data size should be reduced a lot.
2. If a single request of the other party's service takes a long time, there is no way to do it.-_-[contact the boss to see if you can talk about it]
3. If your member credit information is not so real-time, you can use cronjob and other regular run to temporarily save your member information to your local computer, so that further optimization is possible.