Best way to load thousands of data in a fast way [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
i have this Mobile app built with android where data is stored in the server using PHP and MySQL.
Android - Mobile App
PHP - API
MySQL - Database
In Mobile App, we have newsfeed. We have already 150 datas. We recoded the time, its loading 20secs of 150 datas.
Im thinking that i should load only first 10 datas and when scroll down, loads another.
What do you suggest?
Another question. Does MySQL Join makes the query fast?

Yes you can fetch the small chunk of data. For a this you need to handle the query in such a manner that it accept a page number for the data.
For example if you are fetching the record 1-10, you will pass the page number 1 and accordingly you will get a result.
Also you make use of Endless Adapter in your android app

Related

How to create price comparison website using opencart 2.x [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am using OpenCart for development.
I have affiliate API of Amazon,ebay,Flipkart and Snapdeal. I want to combine all API results to my web page with pagination. Like this website https://www.compareraja.in/mobiles.html.
My question is :
Should I save all API results in the database.?
Is there any method to combine all API results in a shuffled manner and display 1st 10 results then next 10 on load more option.
Yes, you should save all api results in database like you add product in admin panel. because there is some limitation to call api, for example limit of 5 call per second. what happen if your site traffic exceed api call limit, so always save api result to database for better performance. You should consider InterStore extension for plug & play solution.
If you have imported products from api to database, you don't need to create pagination because opencart already have this functionality

How to receive notification in android if a data is inserted in the database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a mySQL database, and I created a simple android app that can display the data from the database using json. And I want to add the function wherein if a data is inserted in my database, the android app will be notified.
For example.I have two android app(App "A" and "B"). App "A" can Insert Data, and "B" can Display the data. I'm thinking of, everytime that App "A" Inserts a data, App "B" will be notified, and can refresh the current displayed data. I am thinking of refresh the list every certain time(5-10sec), but it seems to add more process time, and I think maybe refreshing it only when a data is inserted in the database would be better. Is there a way to do this? Hope that you can provide me some knowledge on how to do this. And if possible some example codes. Thank you.
So if your backend is built using php, this is possible. I assumed that because you've set PHP as a tag.
Every time someone request to insert data to your php, you can insert it into MySQL and if insert went OK you could Google Cloud Messaging (GCM): https://developers.google.com/cloud-messaging/
Read documentation well, because GCM is not one-liner. It requires setup on Google console, your PHP server and Android app.

Laravel 5.2 Application - autosync two mysql databases [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have created web application using laravel, now I need to add functionality for users that when there is no internet connection available data must be stored in their local database, and when the system get internet connection than the data should be sync with the live sever. If we have only one client and one sever than I can use master-salve deployment, but here in my case there are more than 1 local clients.
Instead of having two databases you could tweak the front end a little bit to save data in HTML5's localStorage in a neat JSON format so when the user reconnects, you could just push the localStorage items with AJAX and iterate through the array of json objects storing them in empty model objects and save them each.
As for old data, you could store their ID's also in the localStorage so you can just update them which you could easily do with $some_model->update()

Updating a MySQL table every couple of seconds with large amounts of data? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I've create an application that has an autosave feature. So instead of the user having to click a save button, their settings are automatically saved with every interaction with app. Behind the scenes, every time the app changes, I POST the data to PHP and update a MySQL database table.
It's working well but nobody's using it yet so my question is: If I'm updating a MySQL database table with this save data (and the saved data could be the equivalent of a 100kb XML file) every couple of seconds, could I experience performance issues? It should be noted that there could be hundreds or thousands of users using the app at the same time.
Any tips or advice would be appreciated.
Bundle up and serialize all your data changes into a single JSON object before POSTING (as a single field). Fewer large interactions will offer better performances than constant tiny ones.

How to create php pagination without page numbers [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I need to create pagination and it should not have page numbers as if I have it then I need to load all data at page loading.(I was ordered to do so)
I am little bit lost. Don't know where to start Even a little help is highly appreciated.
using zend framework 2(MVC)
new to php and zend
Prefer not to use library
I am assuming, What you mean is that you cannot have page numbers listed with the results on your page, but just a forward and a back button. You keep track of what offset/limit results are being currently viewed by user, and depending on if the user clicks back/forward, you will send an appropriate request to server with offset and limit as parameters. The server based on php/Zend should return results based on this offset and limit.
I have had a precursory look at Zend Pagination and it seems to me that it should work for you.

Categories