I am building REST API using Phalcon Micro and i am storing log data in AWS DynamoDB. In my controller I have written code for storing log just before returning response to client.
    mycontroller.php
            function mycontroller(){
                do this
                do that
                writetoDynamoDB
                return $result;
        }I have observed that response time has increased due to storing of log data. How could i increase the performance of the API and also store log data at same time.
I am working on optimizing the queries, have included Redis caching but i need suggestions on storing log data.
Any help is very much appreciated.