Skip to content

Reflections

Anirudh Mallya edited this page Dec 4, 2018 · 2 revisions

Possible performance issues with the system

Data Formatting

According to FlaskRESTPlus documentation, it provides the fields module and the marshal_with() decorator which have fields that should not be specified in order. By default, fields order is not preserved as this has a performance drop effect. If one requires fields order preservation, they can pass an ordered=True parameter to some classes or function to force order preservation. This should be kept in mind while designing RESTPlus classes.

Number of queries and database storage

As the project is scaled and number of users increase rapidly, the number of queries on books and collections may heavily affect system performance. Also, storing and managing a plethora of users will require a well-designed system. This is an important concern once our library web service is used large-scale. A work around this could be to cache data. Caching data in the application allows us to reduce calls to database and save additional computation.

Running the server large-scale

Often, developers have experienced latency increase from deploying their local solution to a large-scale API. A workaround to fix this could be to pass in a "threaded=True" parameter in app.run(). This allows the system to allow all of its cores to be able to handle high load and parallel processing of data.

Many, many-to-many relationships in database

The probability that our library contains multiple books that can be a part of multiple collections could result in a vast number of many-to-many relationships. Some developers have reported issues in response time being extended up to 1-2 minutes per request (about 12 - 24 times the usual response time) with SQLAlchemy in such situations.