8月 112014
 
  1. sqlite中的锁: http://www.cnblogs.com/stephen-liu74/archive/2012/03/02/2328753.html
  2. sqlite中的临时文件: http://www.cnblogs.com/stephen-liu74/archive/2012/03/01/2328483.html
  3. http://www.cnblogs.com/stephen-liu74/category/348367.html

问题:

  1. sqlite查询时能否明确指定不加锁?
 Posted by at 下午 2:52
5月 282011
 

ttulmgr

The command ttulmgr' is the utility to export and import the update log.  It is useful to filter the update log with such text utilities as grep‘ and sed'.  This command is used in the following format.  upath‘ specifies the update log directory.

ttulmgr export [-ts num] [-sid num] upath
Export the update log as TSV text data to the standard output.
ttulmgr import upath
Import TSV text data from the standard input to the update log.

Options feature the following.

  • -ts num : specify the beginning time stamp.
  • -sid num : specify the self server ID.

This command returns 0 on success, another on failure.

 

注意

1. 指定 sid 的作用不是说只查看sid产生的日志,而是说不要查看sid产生的日志,源码(ttulmgr.c,procexport函数)中是这么写的:  

2. 通过上图的189行可以知道,输出只能是16进制的个数,不能是ascii码的

3. 输入格式说明:

   1306566730093092        3101:3101       put     C8 10 00 00 00 43 00 00 00 4E 54

   其中:

      1306566730093092 是微妙级时间戳

      3101:3101 分别是 sid:mid   即: serverid ,masterid; 如果masterid没有,则为0

      put: 是指令的文本描述

      c8…: 这些就是指令参数的16进制表示了

 Posted by at 上午 1:38
5月 102011
 

tokyo tyrant采用的是从机向主机拉式的主从同步策略,并且有一个限制,一个从库只能从一个主库同步数据。另外tokyo tyrant在写操作的时候都会加锁。这样对同一个key的写操作就会被顺序执行,不会出现并发操作的情况。且主辅库均可进行读写操作。

下面是几种同步策略:

1.

2.

3.

 Posted by at 上午 9:07
5月 092011
 

如下的遍历方式效率是比较低的:
1. 因为是用的迭代的方式,所以内存使用很少
2. 迭代的过程如下,效率是非常地的:
    sendto(3, "\310Q", 2, 0, NULL, 0)       = 2  (continue)
    recvfrom(3, "\0\0\0\0CTGT-MTI5NjI0OTk5MA==-130492"…, 65536, 0, NULL, NULL) = 72 (接收key)
    sendto(3, "\3100\0\0\0CTGT-MTI5NjI0OTk5MA==-13049"…, 73, 0, NULL, 0) = 73 (get key)
    recvfrom(3, "\0\0\0\0L{\"uid\":\"1296249990\",\"et\":13"…, 65536, 0, NULL, NULL) = 81  (接收value)

测试脚本:
 

 
  1. <?php
  2.         $tt = new TokyoTyrant();
  3.         $connected = $tt->connect($host$port);
  4.         $it = $tt->getIterator();
  5.         foreach ($it as $key=>$val) {
  6.         
  7.         } 
 Posted by at 下午 8:31
12月 032010
 

ACID,是指在数据库管理系统DBMS)中事务所具有的四个特性:原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation,又称独立性)、持久性(Durability)。

在数据库系统中,一个事务是指由一系列数据库操作组成的一个完整的逻辑过程。例如银行转帐,从原账户扣除金额,以及向目标账户添加金额,这两个数据库操作的总和构成一个完整的逻辑过程,不可拆分。这个过程被称为一个事务,具有ACID特性

 Posted by at 上午 5:04
12月 012010
 

官方地址:
http://www.mongodb.org/

windows上安装mongodb:
安装为服务:
d:\Program\mongodb-win32-i386-1.0.0\bin\mongod.exe –dbpath d:\Program\mongodb-win32-i386-1.0.0\data –install

注意事项:
1。 使用绝对路径执行该命令
2。 默认的data目录为: c:\data\db , 如果需要修改的话, 安装服务时使用 –dbpath 选项

 Posted by at 下午 11:08
11月 212010
 

       Oracle Berkeley DB最先由加州大学伯克利分校为了移除受到AT&T限制的dbm代码,而从BSD 4.3到4.4时所改写的。经过将近二十年的衍化,目前Oracle Berkeley DB家族已经发展到包含4个独立产品线 – Berkeley DB、Berkeley DB Java 版、Berkeley DB XML和Mobile Server,被应用到行行业业,在全球有超过2亿的部署

        

  • Oracle Berkeley DB 产品家族介绍: http://www.bdbchina.com/2010/09/oracle-berkeley-db-产品家族介绍/
        
        

  • 官方地址: http://www.oracle.com/technetwork/database/berkeleydb/overview/index.html
        

  • BDB中国: http://www.bdbchina.com/

BDB的 11.2.5版本将支持sql语句(DBSQL)。

DBSQL接口是一个1M大小的C语言类库,是一个高效并发的嵌入式数据库。它支持in-memory  cache选项,某些场合可作为内存数据库的一个替代方案。它支持C/C++/Java/PHP等语言接口和通过JDBC/ODBC等驱动程序访问。它运 行于Unix/POSIX、Windows家族、VxWorks、QNX、Android等平台。和SQLite一样,支持SQL92标准。

 Posted by at 上午 7:53