No one wants their app to be slow! Yet, we all may end up with not optimal solutions that may slow down responses of API Platform-based applications. During this speech, together, we will discover typical pitfalls and how to spot them and address them.
This presentation will focus on the application-level things we may change to improve our response times.
27. How many queries are executed here?
{
"@context": "/api/contexts/Order",
"@id": "/api/orders",
"@type": "hydra:Collection",
"hydra:totalItems": 3,
"hydra:member": [
{
"@id": "/api/orders/1",
"@type": "Order",
"id": 1,
"orderItems": [
"/api/order_items/1",
"/api/order_items/2"
]
},
{
“…”: “…“
}
]
}
Amount of orders: 3
Every order associated with 2 items
Sample query on the left
No total
fi
eld
32. How many queries are executed here?
{
"@context": "/api/contexts/Order",
"@id": "/api/orders",
"@type": "hydra:Collection",
"hydra:totalItems": 3,
"hydra:member": [
{
"@id": "/api/orders/1",
"@type": "Order",
"id": 1,
"orderItems": [
"/api/order_items/1",
"/api/order_items/2"
],
"total": 7000
},
{
“…”: “…“
}
]
}
Amount of orders: 3
Every order associated with 2 items
Sample query on the left
Added “total()” as a function of product
price and quantity of item
71. How many updates are executed?
Product has a
fl
oat price
fi
eld de
fi
ned as
fl
oat
Order item quantity has been changed by 1
During which we will read data from Product
73. How many updates are executed?
Product has a
fl
oat price
fi
eld de
fi
ned as decimal
Order item quantity has been changed by 1
During which we will read data from Product