cassandra - Can Cassandra be used to both replicate, provide a 'master' and filter data at sites?
问题描述
I'm researching tech for a new project.
We have a number of sites, whose data should come from a master server. Each site can only have the data on it that is relevant to the owner (company) of the site. Each site may have a number of independent machines, each with the own DB.
The master would have all data for all sites/machines. Offline usage with sporadic connectivity is expected.
I can use something like symmetric-ds to do this with an RDBMS. e.g: setup per-site replication such that each site only receives data relevant to that site.
What that doesnt get me (at least, automatically) is the ability for a write to one of the local machines, to be automatically replicated to the other machines that are at that site. This is important in the offline case, where writing to machine A on a site won't automatically cause the same write/update to occur at machine B of the same site. The write to B will occur naturally as a part of symmetric-ds replication when the connection comes up, but I need something that'll work locally when the connection is down.
I'm wondering if something like Cassanda is suitable for this?
I'm thinking:
- Each site is a set of replicas for itself (even if that site it just one machine)
- Each site replicates data to a master site
- Writes at the master are replicated to relevant sites (based on the content of the data)
解决方案
Out of the box there is no such functionality in Cassandra. Theoretically you may build something like you need using the DSE's Advanced Replication functionality, but this requires experimentation to build correct solution. Although if decision is based only on content, then maybe this won't work as well.
Default cross-DC replication in Cassandra may sustain downtime, especially if your software is using correct consistency levels when writing/reading data. But all data will be replicated to all DCs, until you separate them into different keyspaces that all will have master as one DC, and inidividual DCs as 2nd DC.
推荐阅读
- blogger - 如何修复博客中的多个重定向
- python - 我有字典作为熊猫数据框列中的值。我想将键列和值作为列值
- r - 安装包“tinytex”的退出状态非零
- postgresql - 在 PostgreSQL 中使用几个 Temp 变量
- java - Java 方法能否根据方法中的条件返回不同的类型?
- python - 在 python 中编写 Discord 机器人 - 如何让机器人从一组图像中发送随机图像?
- markdown - Mathjax + Markdown + Jekyll,移动设备白色对象覆盖数学文本问题
- ruby-on-rails - 未创建数据库记录,可能是关系问题?
- c++ - 为什么这些指针是相同的,却指向一个对象的不同实例?
- asp.net-core-webapi - 在 ASP NET Core Web API 中进行 OTP 验证后发出 JWT