あまみや ゆうこ » 2016 » 8

.NET开发者如何使用MyCat?

背景

在开发中,我们设计的系统的效率在很大程度上会受到数据库引擎单表的性能制约,因此在数据量庞大、或记录过宽时,需要考虑分库分表从而减轻数据库压力,提升查询效率。此外配置读写分离,让主数据库处理事务性查询,而从数据库处理SELECT查询。数据库复制被用来把事务性查询导致的变更同步到集群中的从数据库。使用读写分离最大的作用无非是缓解服务器压力。

什么是MyCat?

file

从定义和分类来看,它是一个开源的分布式数据库系统,是一个实现了MySQL协议的服务器,前端用户可以把它看作是一个数据库代理,用MySQL客户端工具和命令行访问,而其后端可以用MySQL原生协议与多个MySQL服务器通信,也可以用JDBC协议与大多数主流数据库服务器通信,其核心功能是分表分库,即将一个大表水平分割为N个小表,存储在后端MySQL服务器里或者其他数据库里。

MyCat发展到目前的版本,已经不是一个单纯的MySQL代理了,它的后端可以支持MySQL、SQL Server、Oracle、DB2、PostgreSQL等主流数据库,也支持MongoDB这种新型NoSQL方式的存储,未来还会支持更多类型的存储。而在最终用户看来,无论是那种存储方式,在MyCat里,都是一个传统的数据库表,支持标准的SQL语句进行数据的操作,这样一来,对前端业务系统来说,可以大幅降低开发难度,提升开发速度。

此外,开发者可以根据不同的需求将表分配不同的数据节点,比如Table A存放在关系型数据库中(如MySQL),而Table B可能更适合NoSQL(如MongoDB),在MyCAT中开发者只需要简单配置,即可让MyCAT完成这一系列操作的路由。

MyCat的优势

更多内容 »

Published on 8/23/2016 11:27:27 PM

MyCat Getting Started

What is MyCat?

file

MyCAT is an Open-Source software, a large database cluster oriented to enterprises. MyCAT is an enforced database which is a replacement for MySQL and supports transaction and ACID. Regarded as MySQL cluster of enterprise database, MyCAT can take the place of expensive Oracle cluster. MyCAT is also a new type of database, which seems like a SQL Server integrated with the memory cache technology, NoSQL technology and HDFS big data. And as a new modern enterprise database product, MyCAT is combined with the traditional database and new distributed data warehouse. In a word, MyCAT is a fresh new middleware of database.

The target of MyCAT is to smoothly migrate the current stand-alone database and applications to cloud side with low cost and to solve the bottleneck problem caused by the rapid growth of data storage and business scale.

Why use MyCat?

  • Based on Alibaba open-source project Cobar, whose stability, reliability, excellent architecture and performance, as well as many mature use-cases make MyCAT have a good starting. Standing on the shoulders of giants, MyCAT feels confident enough to go farther.
  • Extensively drawing on the best open-source projects and innovative ideas, which are integrated into the Mycat’s gene, make MyCAT be ahead of the other current similar open-source projects, even beyond some commercial products.
  • MyCAT behind a strong technical team whose participants are experienced more than five years including some senior software engineer, architect, DBA, etc. Excellent technical team to ensure the product quality of Mycat.
  • MyCAT does not rely on any commercial company. It’s unlike some open-source projects whose important features is enclosed in its commercial products and making open-source projects like a decoration.
  • Supports individual databases like MySQL, SQL Server, Oracle, MongoDB, DB2...

更多内容 »

Published on 8/23/2016 5:42:16 PM

Ubuntu 14.04下配置用于缓存目的的Redis

对于我这个万年不搞运维的人,终于轮到我了。。。

安装

官网提供了最新源代码的下载地址,我们需要在Ubuntu上编译。

# wget http://download.redis.io/releases/redis-3.2.3.tar.gz
# tar xzf redis-3.2.3.tar.gz
# cd redis-3.2.3
# make

② 在/etc下创建redis文件夹,将第一步中解压的redis.conf复制到/etc/redis文件夹中。

更多内容 »

Published on 8/9/2016 2:59:30 AM