MySQL 存储引擎及比较

查看当前数据库中安装的存储引擎:

mysql> SHOW ENGINES;
+------------+---------+----------------------------------------------------------------+
| Engine     | Support | Comment                                                        |
+------------+---------+----------------------------------------------------------------+
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     |
| BerkeleyDB | NO      | Supports transactions and page-level locking                   |
| BLACKHOLE  | NO      | /dev/null storage engine (anything you write to it disappears) |
| EXAMPLE    | NO      | Example storage engine                                         |
| ARCHIVE    | YES     | Archive storage engine                                         |
| CSV        | NO      | CSV storage engine                                             |
| ndbcluster | NO      | Clustered, fault-tolerant, memory-based tables                 |
| FEDERATED  | NO      | Federated MySQL storage engine                                 |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          |
| ISAM       | NO      | Obsolete storage engine                                        |
+------------+---------+----------------------------------------------------------------+
12 rows in set (0.00 sec)

1. MyISAM存储引擎
MyISAM是默认存储引擎。它基于更老的ISAM代码,但有很多有用的扩展。

继续阅读“MySQL 存储引擎及比较”

在Spring中使用ActiveMQ发送邮件

环境:Spring 2.5, ActiveMQ 5.1

  项目的后台要求在更改密码后发送邮件通知用户,为了避免发送邮件时程序对用户操作的阻塞,之前中文版中使用了线程来发送邮件,而在英文版中,我决定使用JMS来异步发送邮件,让用户更改密码的操作和发送邮件的操作更进一步解耦,也在实际环境中试试JMS。

  我们的环境是Spring 2.5, Tomcat 5.5,使用ActiveMQ来实现JMS传送和接收。

  首先,我们在Spring中加入ActiveMQ Broker的配置:

    <bean id="broker"
        class="org.apache.activemq.xbean.BrokerFactoryBean">
        <property name="config"
            value="classpath:activemq.xml"></property>
        <property name="start"
            value="true"></property>
    </bean>

  我们在此处配置了BrokerFactoryBean,此Bean实现在Spring中配置嵌入式Broker,并且支持XBean方式的配置。Broker的配置文件由config属性指定,此处定义配置文件位于classpath中的activemq.xml。

继续阅读“在Spring中使用ActiveMQ发送邮件”

Pages:  1 2 3 4 5 6