标签:
Kooboo CMS can almost support all the types of database, include the relational database and No-SQL database. Right now, we have implemented five types database provider for text content: XML, SQLCe, SQLServer, MySQL and MongoDB.
The xml provider is a configure-less, structure-less and simplest provider. It is the default provider include in the default release package.
The xml provider is also used on the site exporting/importing function. When exporting one site from the Kooboo CMS with non-default providers, the site will be exported as a site package using the default providers. When the site package being to import into a Kooboo CMS instance with non-default providers, it will convert the xml data into the specific database.
Highly recommended used in the development, do not used in the production.
SQLCe provider is a relational database similar with SQLite. It is configure-less but have structure tables. Every sites in the same Kooboo CMS instance will has its owner standalone database file. It usually use in the site which each table with less than 50000 rows data.
All the relational database[SQLCe,SQLServer, Mysql] have the same characteristic is they will always the dynamic tables for each content type, but it transparent to the users.
Usage:
SQLServer provider have two modes:
Usage:
<SqlServerSettings xmlns="http://schemas.datacontract.org/2004/07/Kooboo.CMS.Content.Persistence.SqlServer" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Connections>
<ConnectionSetting>
<ConnectionString>Server=.\SQLExpress;Database=Kooboo_CMS; Trusted_Connection=Yes;</ConnectionString>
<Name>Sample</Name>
</ConnectionSetting>
</Connections>
<CreateDatabaseSetting>Server=.\SQLExpress;Database=Kooboo_CMS; Trusted_Connection=Yes;</CreateDatabaseSetting>
<SharingDatabase>true</SharingDatabase>
<SharingDatabaseConnectionString>Server=.\SQLExpress;Database=Kooboo_CMS; Trusted_Connection=Yes;</SharingDatabaseConnectionString>
</SqlServerSettings>
MySQL provider usually used on MONO/*UNIX, and some shared web hosting do not support SQLServer.
Usage:
<MysqlSettings xmlns="http://schemas.datacontract.org/2004/07/Kooboo.CMS.Content.Persistence.Mysql" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ConnectionString>Server=127.0.0.1;Database=Kooboo_CMS;Uid=root;Pwd=;charset=gbk;</ConnectionString>
<DEFAULT_CHARSET>utf8</DEFAULT_CHARSET>
</MysqlSettings>
MangoDB is a key-value database. It usually used in the site have a lot document but have few relations.
Usage:
<DatabaseSettings xmlns="http://schemas.datacontract.org/2004/07/Kooboo.CMS.Content.Persistence.MongoDB" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ConnectionString>mongodb://localhost</ConnectionString>
<SharingDatabase>false</SharingDatabase>
</DatabaseSettings>
Migrating the site between different Kooboo CMS instances is a really great feature. For example: We can develop the site under the XML provider instance, but want to deploy the to another production instance with SQLServer.
Usage:
Kooboo中如何切换数据库(注意:如果切换数据库,需要Kooboo中没有一个website 否则会报错数据库中没有表之类的)
标签:
原文地址:http://www.cnblogs.com/haoliansheng/p/4217265.html