3

I want to ask a question that involves several topics: a PHP framework, MySQL database, user experience, page loading performance, server performance. Since the question is complex, I can't find a suitable answer after thoroughly googling.

I feel that if I reduce the scope of the question I may be having an incomplete answer. But maybe that is the only way to tackle this.

I'm not sure which Stack Exchange site would be the best fit for that question. For example, Stack Overflow would seem a good fit, but it would lack the user experience part, or it would be deemed as off-topic. The same could happen with other Stack Exchange sites.

The actual question would be:

What should be the best practice when fetching records from the database to show in an index page?

I'm developing an application using the framework CakePHP, with MySQL as database.

  • The maximum number of records to fetch from a table are not more than 2000.

  • To show in an index page, I'm fetching the whole 2000.

  • For pagination I use the JavaScript DataTables plugin.

  • The user base of the application is no more than 10.

I found that the delay fetching the 2000 +/- records is negligible in page loading. And as all the records are in the client's side, making searches via DataTables without any delay.

Modern web browsers and internet speeds seems to handle this amount of data without a blink.

Discussing with some colleagues, they told me that I should paginate fetching, 10 (for example) records at a time, making a query to the server each 10 rows.

My take on this is that fetching 10 records at a time (I'm not using Ajax), could hurt the user experience, since implies a delay in every click and in every search. Also seems to me that the server side performance and efficiency is not really something serious.

Taking into account all of these considerations,

is there a preferable maximum of records to be fetched, or the best practice is always fetching n records at a time?

Do you have a site recommendation, or how should I approach this situation?

1
  • 1
    I'm not a member of those sites with the expertise you'll need, but I've noticed on meta that "Don't ask for what's the "best practice", it's off-topic" advice is given quite a bit. Those are perhaps trigger words likely to lead to closure. – A Rogue Ant. Apr 20 at 16:21
10

I want to ask a question that involves several topics: a PHP framework, MySql database, user experience, page loading performance, server performance. Since the question is complex, I can't find a suitable answer after thoroughly googling.

That might be a sign that a question, even if there was a site where it would be completely on-topic, is too broad.

You could split the question into several subquestions, each focusing on a different part. The user experience part should go to User Experience; it probably results in some requirements you need to impose on the solution. When developing the solution, you may run into more technical problems which could be on-topic on e.g. Stack Overflow or Database Administrators.

Alternatively, hire a good software architect or a experienced developer and ask them for advice. There are people making a living from design decisions like this, because it is a complex topic.

2
  • Thanks for your answer. All the things you mention crossed my mind, so I wanted to hear other thoughts to see what would be the best way to handle this problem. – schrodigerscatcuriosity Apr 20 at 15:57
  • 1
    Sadly my financial situation doesn't allow me to do that, which I would like very much, since my formation is as a programmer, and in the organization I'm working there are no other people with this type of technical skills. – schrodigerscatcuriosity Apr 20 at 16:03
4

I'd go with Stack Overflow myself.

Anything specific you need to drill into with experts can be carved out of your question (and possibly answers) and posted on the most appropriate site.

Don't underestimate the wide degree of expertise on SO - many developers will be engaged with projects involving database access and consuming said data.

1
  • Thanks for your answer. I don't underestimate SO :), but they can usually be a little impatient, and therefore consider at least part of the question off topic. – schrodigerscatcuriosity Apr 20 at 15:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .