nosql

干货 | 京东云数据库 RDS助力企业便捷运维

↘锁芯ラ 提交于 2019-12-07 17:20:30
iPhone6发布那年,京东在国贸等商圈送货最快速度数分钟,包括从下单到送达。这是一个极端的富含营销因素例子。即便如此,常态来看,隔天到货的这种业务模式,也是基于同样的支撑:营销业务、物流业务,大数据业务,数据平台和数据。 京东云在集团中担负着对外助力企业发展的责任。因为京东云的整体产品线确实特别丰富,因此呢,我今天特别把比较有代表性的数据体系提出来,管中窥豹。 希望在有限的篇幅内,围绕着数据生态,跟大家进行以下话题的交流:京东数据生态的主要涉及的范围有哪些?为什么京东数据生态可以主力企业架构的优化?落到两个层的解读:一是京东的数据生态是否可以在宏观层面上给企业的管理者一些灵感;二是开发、运维、战术性管理的执行落地层面。 一、数据生态助力企业架构 首先我要表明的一个观点是,互联网模式或者思维不是所谓的互联网公司的专利。传统工业巨头拿互联网来武装,会更加凶悍。在互联网思维下,玩转一个模式下,无非这么几个要素,算力,平台,算法、数据、流量,加上具体的业务运营。对于一个企业来说,云、数据、AI这些要素,绝对不仅仅是一种简单的对业务的支撑,同时也使一种对业务的驱动,更帮助企业领导人重新思考IT架构,企业架构。 基于这些要素,今天的主题是数据,我希望京东云的数据生态可以帮助您的企业达到这样的一个数据目标:易使用(效率)、不出错(数据质量)、不泄露(数据安全)、产价值(数据变现)。

redis&memcached&SQL&NoSQL

丶灬走出姿态 提交于 2019-12-07 16:26:03
Why 一个应用肯定有两部分逻辑:数据逻辑和业务逻辑。 数据逻辑包括各种I/O,和内部的数据的处理,也就是在内部如何组织数据结构,变量也属于这一部分。 当一个应用变成一个进程,它负责数据逻辑的部分就有了两个选择: 将数据存在内存中,存在内存中的数据如果变得很重要,就需要保存进磁盘,所以有可能需要持久化的逻辑。为了更好的使用数据,需要有很好的数据结构建模,虽然基本的数据结构,甚至一些复杂的在程序语言或者库中都有集成,但是语言不负责执行,所以执行这一块还是进程自己在做。 将数据存在磁盘中,这需要有存/取得逻辑,在取的这一部分,基于业务可能要有强大的检索逻辑 当应用的数据规模变得很大,相应的数据逻辑和业务逻辑也会变得很复杂 从效率上来说,是时候考虑分布式了,所以我们有必要将和数据有关的逻辑独立出去,比如磁盘上的检索,内存中数据的持久化等。 从开发和维护的角度来说,集中精力在业务而不是数据,可以使得代码量变少,开发速度和可维护性都大大提高。 How 显然要将数据逻辑尽可能独立出去,就要用到工具软件,redis、memcached、Sql,NoSql都是这个目的的工具 redis、memcached 侧重于内存中的数据 内存中的数据都有时效性,所以这两个工具都支持expire memcached 只负责 数据的存、取和超时,在取得部分也不考虑复杂得检索逻辑 redis则更强大

Creating multiple GSIs by updateTable - DynamoDB

天大地大妈咪最大 提交于 2019-12-07 14:26:28
问题 I'm uisng updateTable of DynmaoDB and based on the documentation, if we want to create multiple Global Secondary Indexes (GSIs) we need to have multiple objects in "GlobalSecondaryIndexUpdates" field, so I'm passing the following params, but it does not update the GSIs; however if I'm just creating one GSI (passing one object in "GlobalSecondaryIndexUpdates" field, it works); here is the params I'm passing for creating multiple GSIs: { "TableName": "movies", "AttributeDefinitions": [{

“Within X miles” search in mongodb

匆匆过客 提交于 2019-12-07 13:51:31
问题 I want to be able to find zip codes are that within a specific radius of distance from another zip code. I have some code from this source. But it is an SQL implementation using ActiveRecord. It is precisely the implementation I want but only with MongoDB. Help! 回答1: Take a look at the MongoDB documentation and the Mongoid indexing docs. class Zip include Mongoid::Document field :code field :location, :type => Array # make sure to rake db:mongoid:create_indexes index [[ :location, Mongo:

【NoSql】Redis实践篇-简单demo实现(一)

做~自己de王妃 提交于 2019-12-07 12:17:53
Redis是一个key-value存储系统。Redis的出现,很大程度补偿了memcached这类key/value存储的不足,在部分场合可以对关系数据库起到很好的补充作用 Redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sortedset--有序集合)和hash(哈希类型)。这些数据类型支持push/pop、add/remove及取交集并集和差集及更丰富的操作,而且这些操作都是原子性的。在此基础上,redis支持各种不同方式的排序。与memcached一样,为了保证效率,数据都是缓存在内存中。区别的是redis会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记录文件,并且在此基础上实现了master-slave(主从复制)。 Memcache 与 Redis 区别 Memcache 提供的数据类型少,只有键值对, Redis 提供的数据类型相对较多 Memcache 关机就没了,数据全部存到内存当中,但是没有提供故障恢复, Redis 可以将数据存储到磁盘中 redis 提供主从复制, Memcache 无 Memcache 是多线程的(使用协议解决的), redis 是单线程 Windows下Redis的安装使用 1 ,安装 Redis

HBase: atomic 'check row does not exist and create' operation

孤人 提交于 2019-12-07 11:53:55
问题 I suggest this should be one of common cases but probably I use wrong keywords when googling around. I just need to create new table record with completely random key. Assume I obtained key with good randomness (almost random). However I can't be 100% sure no row yet exists. So what I need to do atomically: Having row key check no row exists yet. Reject operation if row exists. Create row if it does not exit. Most useful piece of information I found on this topic is article about HBase row

Go语言操作mongoDB

╄→гoц情女王★ 提交于 2019-12-07 09:40:33
Go语言操作mongoDB mongoDB是目前比较流行的一个基于分布式文件存储的数据库,它是一个介于关系数据库和非关系数据库(NoSQL)之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的。 mongoDB介绍 mongoDB 是目前比较流行的一个基于分布式文件存储的数据库,它是一个介于关系数据库和非关系数据库(NoSQL)之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的。 mongoDB中将一条数据存储为一个文档(document),数据结构由键值(key-value)对组成。 其中文档类似于我们平常编程中用到的JSON对象。 文档中的字段值可以包含其他文档,数组及文档数组。 mongoDB相关概念 mongoDB中相关概念与我们熟悉的SQL概念对比如下: MongoDB术语/概念 说明 对比SQL术语/概念 database 数据库 database collection 集合 table document 文档 row field 字段 column index index 索引 primary key 主键 MongoDB自动将_id字段设置为主键 primary key mongoDB安装 我们这里下载和安装社区版, 官网下载地址 。 打开上述连接后,选择对应的版本、操作系统平台(常见的平台均支持)和包类型,点击Download按钮下载即可。

Cassandra API equivalent of “SELECT … FROM … WHERE id IN ('…', '…', '…');”

时光总嘲笑我的痴心妄想 提交于 2019-12-07 09:08:44
问题 Assume the following data set: id age city phone == === ==== ===== alfred 30 london 3281283 jeff 43 sydney 2342734 joe 29 tokyo 1283881 kelly 54 new york 2394929 molly 20 london 1823881 rob 39 sydney 4928381 To get the following result set .. id age phone == === ===== alfred 30 3281283 joe 29 1283881 molly 20 1823881 .. using SQL one would issue .. SELECT id, age, phone FROM dataset WHERE id IN ('alfred', 'joe', 'molly'); What is the corresponding Cassandra API call that would yield the same

Convert any Elasticsearch response to simple field value format

白昼怎懂夜的黑 提交于 2019-12-07 07:53:26
On elastic search, when doing a simple query like: GET miindex-*/mytype/_search { "query": { "query_string": { "analyze_wildcard": true, "query": "*" } } } It returns a format like: { "took": 1, "timed_out": false, "_shards": { "total": 1, "successful": 1, "failed": 0 }, "hits": { "total": 28, "max_score": 1, "hits": [ ... So I parse like response.hits.hits to get the actual records. However if you are doing another type of query e.g. aggregation, the response is totally different like: { "took": 1, "timed_out": false, "_shards": { "total": 1, "successful": 1, "failed": 0 }, "hits": { "total":

What's read-before-write in NoSQL?

六月ゝ 毕业季﹏ 提交于 2019-12-07 06:22:37
问题 I read in a book : "Cassandra is an NoSQL database and promotes read-before-write instead of relational model". What does "read-before-write" means in a NoSQL context? 回答1: Read before write means that you are checking the value of a cell before modifying it. Read-Before write is a huge anti-pattern in Cassandra. Any book you read that encourages doing this should be looked at with suspicion. Normally Cassandra writes are performed without having any information about the current state of the