nosql

Count unseen messages in group chat with firestore

余生长醉 提交于 2021-02-08 03:31:31
问题 I want to track the number of unseen messages for each member of a group chat. I store chat metadata in a chats collection, and messages for each chat in messages/{chatId} . I have checked other threads that ask about this, but in this scenario there's a group chat so it's more complicated. The threads that I have read suppose that it's a chat between two people. I have thought about having a new collection seenMsgTimestamps where I store the timestamp of the last message that a certain user

redis

☆樱花仙子☆ 提交于 2021-02-08 02:40:07
一。基本概念 Redis和MongoDB是当前使用最广泛的NoSQL,而就Redis技术而言,它的性能十分优越,可以支持每秒十几万此的读/写操作,其性能远超数据库,并且还支持集群、分布式、主从同步等配置,原则上可以无限扩展,让更多的数据存储在内存中,更让人欣慰的是它还支持一定的事务能力,这保证了高并发的场景下数据的安全和一致性。它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hash(哈希类型) 二。redis安装 $ wget http://download.redis.io/releases/redis-5.0.4.tar.gz $ tar xzf redis-5.0.4.tar.gz $ cd redis-5.0.4 $ make $ make install 在服务器端启动redis-server 在内置的客户端启动redis-cli 客户端进行测试: 客户端关闭服务器 三。redis常用数据类型和命令 redis中所有的数据都是通过键值对的方式存储的,即key:value。key是字符串类型的,value可以是字符串,hash,list,set,sortedset 1.字符串类型(key:string) 1.添加key:value set key value 2

数据库领域又一里程碑式突破!腾讯云TcaplusDB支持过亿DAU游戏

亡梦爱人 提交于 2021-02-07 23:01:37
2020年11月1日晚,《王者荣耀》官方宣布2020年日活跃用户数日均1亿,成为国内乃至全球首个日均DAU过亿的手游。与此同时,腾讯云TcaplusDB作为《王者荣耀》的数据库服务产品,成为全球首款支持过亿DAU游戏的数据库。 任何一款游戏的成功都不是偶然的,《王者荣耀》在保证游戏的挑战性、趣味性和多样性上做了很多功夫,仅系统就有几十个,包括战斗系统、玩家系统、铭文等。目前,《王者荣耀》的后台数据量已高达数百TB,1个区有100多个表且还在不断增加。这就致使了《王者荣耀》对数据库性能、稳定性、扩缩容、成本、游戏特有场景等方面有着更高要求。 对于《王者荣耀》而言,数据库是灵魂,承载着所有系统的信息落地,而专为游戏而生的腾讯云自研分布式NoSQL数据库TcaplusDB,5年来一直为《王者荣耀》的核心数据提供数据库服务。可以说,每一次的玩家登陆、每一局的对战、每一轮的录像回放都是对TcaplusDB的考验,每一次的团战都需要在海量的数据中进行增删改查。 “我们对比过很多数据库,在目前王者的数据容量和并发条件下,TcaplusDB的读写时延是最稳定的!”《王者荣耀》相关技术负责人评价道。在他看来,TcaplusDB高并发、低时延、低成本的性能优势为《王者荣耀》的数据运行和游戏业务场景提供了强劲支撑。 具体来说,TcaplusDB拥有接近无限的水平扩展能力。基于shard分片的分布式技术

Is There Such A Thing As “Multi-Path Push” in Firebase Real-Time Datasbase?

爷,独闯天下 提交于 2021-02-07 14:20:43
问题 I was watching this video which talks about multi-path updates in Firebase. Multi-path updates are great because they allow you to call the firebaseRef.update() method two or more times while having them be one atomic, all-or-nothing operation. This is great, but in my current situation I don't want to use the update() method. Instead, I want to use the FirebaseRef's push method and allow Firebase to generate a unique key for my object. The tricky part is that I have denormalized my data so

2021美赛D题分析与思考

限于喜欢 提交于 2021-02-07 10:39:54
D题概述 以音乐为主题的图建模问题,可能需要一定的图算法(运筹、图神经网络)、图数据库(Neo4.j、Nosql、Graph等)、知识图谱(这块不算很了解只能算感觉)的基础才能很好将问题落地 问题背景 许多歌曲都有相似的旋律,许多艺术家对音乐流派的重大转变做出了贡献。有时,这些变化 是由于一位艺术家影响了另一位艺术家。有时,它是对外部事件(如重大世界事件或技术进 步)的响应而出现的变化。 希望团队开发一种衡量音乐 影响力的模型。这个问题要求你考察艺术家和流派的进化和革命趋势。 需要满足的需求 使用 Influence_Data 数据集或其中的一部分创建音乐影响力的(多个)定向网络,其中影 响者连接到追随者。开发参数来捕捉这个网络中的‘music influence’。通过创建定向影响 者网络的子网络来探索音乐影响力的子集。描述此子网。在这个子网络中,你的‘music influence’指标揭示了什么? 使用 FULL_MUSIC_DATA 和/或音乐特征的两个汇总数据集(具有艺术家和年份)来开发 音乐相似性度量模型。用你的衡量标准,流派内的艺术家比流派间的艺术家更相似吗? 比较流派之间和流派内部的相似之处和影响。流派的区别是什么?流派是如何随着时间的推移而变化的?流派与流派之间是否关联 说明 DATA_ENAFSONCE

PouchDB/CouchDB like alternative for MongoDB

走远了吗. 提交于 2021-02-07 07:19:48
问题 I'm amazed by the sync capabilities of Pouch and Couch DB, but I'm looking for for an alternative that will let me use my MongoDB databases for client-sync. Is there such thing? If there is, I'd like to hear your experience with it, what should I be aware of, if there are any catches, etc... 回答1: Minimongo is specifically what you are looking for. It was originally developed as part of the excellent Meteor framework, but it can now be used independently to get the local db store and

How to achieve localisation with NoSQL

孤街醉人 提交于 2021-02-07 06:18:07
问题 Until now, I've always used relational databases (and was quite happy indeed!). However, recently, I discovered Parse and found it quite nice so decided to give it a try. However, it comes with a NoSQL database. I am still trying to get my head around it. So my question is, how would you recommend achieving localisation? I could think of the following approaches, what do you think? Approach A: Have a single 'strings' field on the document and store all language specific data in that field.

How could a distributed queue-like-thing be implemented on top of a RBDMS or NOSQL datastore or other messaging system (e.g., rabbitmq)?

亡梦爱人 提交于 2021-02-07 02:57:35
问题 From the wouldn't-it-be-cool-if category of questions ... By "queue-like-thing" I mean supports the following operations: append(entry:Entry) - add entry to tail of queue take(): Entry - remove entry from head of queue and return it promote(entry_id) - move the entry one position closer to the head; the entry that currently occupies that position is moved in the old position demote(entry_id) - the opposite of promote(entry_id) Optional operations would be something like: promote(entry_id,

How could a distributed queue-like-thing be implemented on top of a RBDMS or NOSQL datastore or other messaging system (e.g., rabbitmq)?

人盡茶涼 提交于 2021-02-07 02:55:57
问题 From the wouldn't-it-be-cool-if category of questions ... By "queue-like-thing" I mean supports the following operations: append(entry:Entry) - add entry to tail of queue take(): Entry - remove entry from head of queue and return it promote(entry_id) - move the entry one position closer to the head; the entry that currently occupies that position is moved in the old position demote(entry_id) - the opposite of promote(entry_id) Optional operations would be something like: promote(entry_id,

java embedded library on-disk key-value database [closed]

◇◆丶佛笑我妖孽 提交于 2021-02-06 08:23:42
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Improve this question What I think I'm looking for is a no-SQL, library-embedded, on disk (ie not in-memory) database, thats accessible from java (and preferably runs inside my instance of the JVM). That's not really much of a database, and I'm tempted to roll-my-own. Basically I'm