NoSql、Hbase、Cassandra概念化数据库

发布于 2024-12-31 21:56:51 字数 655 浏览 4 评论 0原文

假设我有 1 到 N 的关系,例如

Student , College. 

学生属性:

Name,Surname,CollegeFKey,

大学属性:

CollegeKey,Other,Other.

假设我有一个程序从纯文本文件中读取学生和考试。而且,在这个文件中,我复制了大学和重复的学生。

就像在非规范化表中一样:

CollegeId,Other,Other,Name,Surname,CollegeFkey.

例如

1,x,y,Mike,M,1
1,x,y,R,P,1
...
...
...

,你看,在这种情况下,我必须始终检查在我的规范化数据库中,我仍然没有在 Table College 中插入 2 次键 1。

我如何在 Hbase 或 Cassandra 中解决这个问题?我的意思是,如果我有 10000 个表和行,我不想检查每个主键,然后检查每个 FK,如果插入正常?

我该如何解决这个问题?我可以使用 no-sql 数据库直接在非规范化数据中工作吗? 你能给我链接一个解决这个问题的例子吗?

Suppose I have a relationship 1 to N, for example

Student , College. 

Student Attributes:

Name,Surname,CollegeFKey,

College attributes:

CollegeKey,Other,Other.

Suppose that I have a program which read students and Exams from a plain text file. And, on this file I have duplicated Colleges and Duplicated Studends.

Like in denormalized tables:

CollegeId,Other,Other,Name,Surname,CollegeFkey.

e.g.

1,x,y,Mike,M,1
1,x,y,R,P,1
...
...
...

You see, I have to check in this case always that in my normalized db, I have still not inserted in the Table College 2 times the key 1.

How can I solve this in Hbase or Cassandra? I mean, if I have 10000.. tables and rows, I don't want check for every Primary Key and then for every FK, if it was inserted OK?

How can I solve that? I can use no-sql db for work directly in de-normalized datas?
Can you link me to an example that solve this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷︶言冷语的世界 2025-01-07 21:56:51

您可以将 Cassandra http://wiki.apache.org/cassandra/ 与某些高级语言客户端一起使用(我使用 Hector for java https://github.com/rantav/hector)。在 Cassandra 中,您将描述 ColumnFamily College,在此 ColumnFamily 中,您编写包含学生信息的 Student 列。

You can use Cassandra http://wiki.apache.org/cassandra/ with some high level language client (I use Hector for java https://github.com/rantav/hector). In Cassandra you will describe ColumnFamily College in this ColumnFamily you write Student columns which contains information about students.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文