redis的多机数据库实现,主要分为以下几种: 1.主从复制 2.哨兵模式 3.Redis官方提供的Cluster集群模式(服务端) 4.Jedis sharding集群(客户端sharing) 5.利用中间件代理,比如codis等 其中前三个为服务器端方案,后两个为客户端分区方案,类似于分表分库方 ...
分类:
其他好文 时间:
2020-11-21 12:36:44
阅读次数:
11
db.collection.update( <query>, <update>, { upsert: <boolean>, multi: <boolean>, writeConcern: <document> }) 参数说明: query : update的查询条件,类似sql update查询内w ...
分类:
数据库 时间:
2020-11-21 12:34:02
阅读次数:
13
1.创建两个库,每个库创建两个分表t_order_1,t_order_2 DROP TABLE IF EXISTS `t_order_1`; CREATE TABLE `t_order_1` ( `id` int(10) NOT NULL AUTO_INCREMENT, `amount` int(2 ...
分类:
数据库 时间:
2020-11-21 12:32:56
阅读次数:
12
glc-test:PRIMARY> db.serverCmdLineOpts() { "argv" : [ "/home/work/mongodb/4.0.17/bin/mongod", "--config", "/home/work/mongodb/mongo_28042/etc/mongodb. ...
分类:
数据库 时间:
2020-11-21 12:03:26
阅读次数:
12
命令: rs.conf(); db.runCommand( { replSetGetConfig: 1 } ); ####################################################################################### ...
分类:
数据库 时间:
2020-11-19 12:02:42
阅读次数:
11
MySQL5.6,应该实现在最流行的版本吧?很遗憾有一些功能一直没有,例如:哈希索引T-tree索引原生高可用auto-sharding...画外音:你最希望看到支持什么特性?但,5.6版本中,InnoDB有些有意思的特性,或许是大伙还不清楚的。从这个版本开始,可以支持全文索引了。altertable可以不拷贝表了,且不阻塞写操作,onlineDDL,酷炫吧。画外音:并不是所有的altertabl
分类:
数据库 时间:
2020-11-17 12:03:10
阅读次数:
10
mongodb 官方的go驱动包 go.mongodb.org/mongo-driver 使用起来比较繁琐,最近对其进行了二次封装 github地址:https://github.com/w3liu/go-common/tree/master/store/mongo测试用例如下: func Test ...
分类:
数据库 时间:
2020-11-13 13:16:09
阅读次数:
40
查找admin集合下前10条数据: db.admin.find().limit(10); 插入数据 > post={table: "activityzones", ... fields: [ ... { ... name: "_id", ... type: "ObjectId", ... hidde ...
分类:
数据库 时间:
2020-11-12 13:54:07
阅读次数:
13
Single Field 单字段索引 示例文档:records { "_id": ObjectId("570c04a4ad233577f97dc459"), "score": 1034, "location": { state: "NY", city: "New York" } } 在单个字段上创建 ...
分类:
数据库 时间:
2020-11-10 10:51:59
阅读次数:
8
在你已经安装部署并允许MongoDB服务后,你必须要了解MongoDB的运行情况,并查看MongoDB的性能。这样在大流量得情况下可以很好的应对并保证MongoDB正常运作。 MongoDB中提供了mongostat 和 mongotop 两个命令来监控MongoDB的运行情况。 mongostat ...
分类:
数据库 时间:
2020-11-10 10:44:09
阅读次数:
9