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 was wondering which is the most efficient. Assigning 7 session variables when the user is logged in or passing the user ID and making new sql queries when the information is needed. I want to cater for mobile users with low download allowanaces as well and we don't have free wifi around here.
PHP is all done server side so I don't think there are any considerations here for mobile users, other than the usual ones such as keeping the page downloads small and accessible. In other words, the server resources are the bottleneck here, so go whichever way you like! Generally speaking storing values (caching) is going to be faster in terms of processing, but could use more memory than fetching stuff as you need it.
Related
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'm currently optimizing an application's login process' caching and I'm thinking of using a File based approach, but I'm not so sure if it's the best when it comes to speeding things up. So among the following approach, which would greatly improve my application?
PHP_SESSION
Filebased(physical file)
PDO_Database
FTP
Anything that touches files is less optimal for caching than when staying in memory. Respectively anything that goes via a network is generally even slower. So when it comes to speed you're probably best off using the PHP_SESSION.
Do note however that because it is memory based you also lose the cache when the application or the server is restarted. If this is undesired you should probably go for a file based solution.
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 8 years ago.
Improve this question
I have a website run by php. I have about 80 users that will be signing up within a hour period.
my question is are there any problems that could occur when having lots of people accessing my database all at once?
I mean 80 users is a lot for me, and if some of you people that have way more than that are laughing at me, how many people would it take to mess up a database?
Thanks in advance!
You could use a tool like apachebench to check. Then you could use tools like memcached (or memcachedb if you needed persistence) to dial down the mysql queries. I would also set up mysql slow query logging.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What I want to do is caching every database query into files. The queries will be cached with names including users' user names or user ids. Of course when a user changes its information, the cache file will be replaced with the new one. Even the interactons like friendship between users will be cached.
If I have 1.000.000 users, I will have millios (maybe billions) of files. Is this good or bad for the performance?
This will fill out your file system so it depends on the amount of space you have. Also, this would degrade performance based on the file lookups if you have a large number of active users.
In any case I would recommend using Memcache or APC as the laravel docs say.
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 8 years ago.
Improve this question
I'm very confused about how to do a game work in a browser like monopoly, backgammon, etc. I have knowledge in html, css, php, and my question is what should I start to study/learn to make a game play with anothers on the web, I think what I should start to learn is AJAX, but what else? How can I do the game? How should I arrange the mysql database info for the game... any tips is appreciated. Thanks.
A basic requirement would certainly be Javascript. That's what the "J" in AJAX actually means. You basically need two things: the client-side code dealing with the user input, sending requests to the server, dealing with the responses, managing all the graphics; and the server-side system handling requests triggered by the client code and providing adequate responses. How you should "do the game" and "arrange" the MySQL database strictly depends on the game you want to create. Of course your request is too generic to be able to provide you any meaningful help.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm currently working on a project that uses MySQL for configuration, but now I'm starting to think it could slow down page loads.
So my question is, would it be better to store configuration options (that are read almost every page load) inside an XML/JSON file, or a MySQL database?
Thanks.
One thing to conside is how much config data there is, and perhaps how often it is likely to change. If the amount of data is small, then saving this in a database (if your not already using a db for anything else), would be overkill, equally maintaining a db for something that gets changed once every 6 months would probably be a waste of resources.
I think this depends on your projects. If you want someone else to configure the application through the UI you can put the configurations into the database.
If its just you and some developers, and changes are not made frequently, put them in a file.