Question

whenever we are firing a insert query, for that point of instant that particular table is locked for a span of time. That time can be some micro seconds or some seconds depending upon the row need to be inserted in database.

I am developing an application for a university which have more than a lac of users.

I am taking care of it because last some days i am googleing it and i got the staticstics as follow

10 simple read query = 1 simple write query

The main problem is notification, whenever a teacher put some updates, i am notifying the student and only those student will get notification who are interested. So it may happen that one update may have 10000+ notification and this will definitely take 3-5 seconds (waiting time). So all reads will be in the queue.

So is there any way to get down the waiting time?

Was it helpful?

Solution

Maybe you could use InnoDB instead of MyISAM, as the former has a row-level-locking, whereas the latter has table-level-locking when writing. If you use InnoDB as table engine, only one row is locked, but any other contents may still get viewed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top