Note that there are some explanatory texts on larger screens.

plurals
  1. POIntegrate application with external service
    primarykey
    data
    text
    <p>So basically I want Your opinion about the architecture of project I'm working on:</p> <p>Everything is written in Python using Flask framework. Application provides Restful API that is being used by mobile applications. And now the main issue:</p> <p>Since there are many really complex queries that are being made to MySql server and we want to store data that comes from users for further analysis (e.g which url he visited, what he searched for etc.) I came up with a solution that there will be another web application delivering API (running on top of tornado and MongoDB using async Pymongo driver called Motor), which we will call from within main app. </p> <p>Seems really confusing but the main idea may be presented as:</p> <pre><code>USER -&gt; ACTION, API CALL -&gt; &lt;-&gt; RECEIVE DATA FROM MYSQL FLASK/Server RESPONSE &lt;- DO_STH_WITH_DATA&lt;- -&gt; EXTERNAL API CALL -&gt; TORNADO -&gt; MONGODB </code></pre> <p>I know it looks awful but I'm not good at drawing either :p.</p> <p>Why another application ? First, we want to have separate access to data collected from users that's why we need another Restful API delivering certain resources. My concern is the performance of such a solution and some recommendations (maybe it would be better to integrate everything into one web application, which is not what we want exaclty ?). Have in mind that post calls from our main app will be handled by eventually somehow handled by async calls to mongodb via motor which should have positive impact on performance.</p> <p>EDIT:</p> <p>I shall mention that external api calls will be using celery (that is what we are planning for now anyway).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COI'm a bit confused. Is this an existing system? A new system? A new feature on an existing system? From what I gather, you have an existing front end and back end, and you are trying to add some sort of analytics system via the Mongo stack, is that correct? Have you done any sort of profiling of the existing system to see if you could improve performance enough there (maybe with some sort of memcaching or something) that the whole new stack wouldn't be necessary?
      singulars
    2. COThis is an existing system and I want add to analytics component to it (semi-complex one although). The idea is to use Tornado and Motor via external api calls to update mongo database without giving extra load to current MySQL server (we supposingly will have to deal with 50 req/s and each on will generate complex SELECT queries). Memcaching might be useful but we aim at mobile clients performing different calls so is somehow misses the point (in my opinion at least).
      singulars
    3. COYou might be in danger of overdesigning the system -- you're adding new infrastructure for something that might be handled by something simpler. What are you logging for the user? Is there any reason why you can't just log it into a text file and then bring it into something else for analysis? Are the MySQL servers so bogged down that they just can't absolutely handle the traffic required for the analytics data? Where are the bottlenecks in the existing system?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload