PHP variable application and / or global variable


PHP variable application and / or global variable

I’m thinking of developing a web application with very special needs I’m not sure if PHP can sorting

Imagine an application that when a user makes a request, load in a global variable $ SESSION [’’ ] the contents of a MySQL table that has 3 columns and 10,000 rows. Call this table LANGUAGES application. The table NEVER be modified by users, only by the administrator of the application, and will only be modified in house application update .

The problem that I have not played , but I imagine that will happen will be when 200 users between that table and loaded into the global variable. The server will store ’ Out ’ that table 200 times, once for each user to enter , and each has its own session .

My question is this . Would it be possible to create an application variable or do something so that all users share a variable, which is stored ONLY once in server memory ?

The variable MUST NOT be modifiable . From what I have read is not possible with PHP , but I want to know what will be the OPTIMAL way to make that application.

Any help is welcome and thank you very much .

Duda variable de aplicación y/o variable global

Estoy pensando en desarrollar una aplicación WEB con unas necesidades muy especiales que no estoy seguro si PHP puedo solucionarme

Imaginemos una aplicación que cuando un usuario realiza una petición, carga en una variable global $SESSION[’’] el contenido de una tabla de MYSQL que tiene 3 columnas y 10000 filas. Llamemos a esta tabla IDIOMAS de la aplicación. La tabla NUNCA será modificada por los usuarios, solo por el administrador de la aplicación, y solo será modificada en casa de actualización de la aplicación.

El problema, que no he reproducido, pero que me imagino que ocurrirá, será cuando 200 usuarios entre y carguen esa tabla en la variable global. El servidor almacenara ‘temporalmente’ esa tabla 200 veces, una por cada usuario que entre, ya que cada uno tiene su propia sesión.

Mi pregunta es la siguiente. ¿Sería posible crear una variable de aplicación o hacer algo, para que todos los usuarios compartan una variable, que se almacene SOLO una vez en la memoria del servidor?

La variable NO DEBE poder modificarse. Por lo que he leído con PHP no es posible, pero quiero saber qué manera será la más ÓPTIMA para realizar dicha aplicación.

Toda ayuda es bienvenida y muchas gracias.

PHP can easily handle the end result of what you want to do.

You can be sure that 100 users, entering at once, carrying 100 selects the DB, creating 100 a session variable array 3x10000 not collapse the server?

There must be a way to optimize that

Mysql can handle MILLION of users.

And Apache? can handle MILLION of users and sessions…
I am saying all this is because I have a NO SUPER powerful server

Yes. Google is your friend.

Sponsor our Newsletter | Privacy Policy | Terms of Service