0

I am a developer of e-commerce websites modules. The module displays some dynamic data (html) on website pages with ajax call. Ajax call gets html from database. 1 query for each page load. Database query response size is about 10kb.

My client is worried that this is too much, they wrote they saw significant increment of DB processing consumption because of that. They say that analysing DB queries they see that query-cache is not caching query answer since it's bigger that 10KB.

Is that really something too big? My guess it that my client see increment of DB processing consumption because of something else.

But let's say that each query would return from database html with size 100kb. Would be that something too much if this would happen on each page load? Is that something significant or just minor impact?

I hope somebody can give some insight about that based on own experiences. I have my own answer about that, but it may be too subjective.

Thank you!

ernest1a
  • 131
  • 5
  • I wouldn't implement any system in a way that every page load would need that much data from a database unless absolutely necessary. I would only store the actual data in database, and then generate the actual HTML in the application. But, in general, the answer is "it depends". If there is no need to scale the system for many visitors without big hardware investments, then I guess it is fine. – Tero Kilkanen Nov 03 '17 at 07:43

1 Answers1

0

Without further detail about your systems I do not think anyone can answer your question but I can suggest to approach this issue more systematically.

In this case, maybe you need to get further clarifications from your client. What is the reason for thinking "x"KB is too much? Is that from a previous system or from a certain heavy transaction day? You will also need to understand more how your database is performing. And the web front end.

Have you done any tests or benchmarking for the database? Or do you have a test platform where you run stress tests? Basically, you need to systematically approach this and define "too much". Your client might not be able to tell why 10KB is too much but you should come up with a method to understand why that is so. Some other questions to consider: Can you measure the page loads, system loads, database query times? What kind of queries are these (select? updates?)? Are there any caching involved?

Tux_DEV_NULL
  • 1,083
  • 7
  • 11
  • The thing is that the extension is installed on 1000+ e-commerce websites. So this question is not about specific system but it is a general question if pulling 100kb of data from database for each page load is considered a bad practice or not. – ernest1a Nov 02 '17 at 23:48