English 中文(简体)
高频更新, 表格中的插入器, 多个同时存取
原标题:High frequency Updates,Inserts on table,multiple access simultaneously

我有一个表格,每个用户输入的数据可以更新一个特定的行或插入一行,视时间而定。我想将整个表格存储在主内存中,并在0:00时将记录写入Db,因为记录以后没有用。我读过关于Memcache的文献。这有帮助吗?

最佳回答

从您所声明的要求来看,听起来您想要使用 MySQL s < a href="http://dev.mysql.com/doc/refman/5.5/en/memory-storage-engine.html" rel=“nofolt” >Memory 存储引擎 。记忆表可以快速访问,不会写入磁盘。它们可以用于像会话和缓存这样的瞬时信息。

Operations involving transient, non-critical data such as session management or caching. When the MySQL server halts or restarts, the data in MEMORY tables is lost.

您可获得完全的关联支持, 包括更新、 插入和选择, 供所有会话使用 。

memcached 可能被使用, 但是您必须执行代码中的缓存 。 如果您正在使用一个框架, 它可能已经在基准模型中支持它, 或者您可以在那里执行它 。

问题回答

Just to add - you can just add more memory to INNODB Bufferpool (if you use it). INNDB will use this memory to store information in memory and also save in disk. Memcache can be used to store computed columns, pre-generated HTML, etc...





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签