05-18-2010, 08:07 PM
[eluser]renownedmedia[/eluser]
(Note that the MEMORY engine can't use TEXT columns)
Has anyone tried this, or does anyone know of any potential pitfalls? We're developing an application and anticipate up to a thousand simultaneous users, and minimizing disk I/O would be optimal.
Sure, given a reboot the data would be lost, but it wouldn't seem like session data would be too important. The server/application would likely undergo weekly maintenance and a reboot, so any data in the session could possibly be incompatible with the updated code anyway.
Code:
CREATE TABLE IF NOT EXISTS `ci_sessions` (
`session_id` varchar(40) NOT NULL DEFAULT '0',
`ip_address` varchar(16) NOT NULL DEFAULT '0',
`user_agent` varchar(50) NOT NULL,
`last_activity` int(10) unsigned NOT NULL DEFAULT '0',
`user_data` varchar(512) NOT NULL,
PRIMARY KEY (`session_id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
Has anyone tried this, or does anyone know of any potential pitfalls? We're developing an application and anticipate up to a thousand simultaneous users, and minimizing disk I/O would be optimal.
Code:
1,000 USERS x 628 Bytes (give or take) <= 1MB
Sure, given a reboot the data would be lost, but it wouldn't seem like session data would be too important. The server/application would likely undergo weekly maintenance and a reboot, so any data in the session could possibly be incompatible with the updated code anyway.