鉴于以下HBase架构场景(
from the official FAQ)……
How would you design an Hbase table
for many-to-many association between
two entities,for example Student and
Course?I would define two tables:
Student: student id student data
(name,address,…) courses (use
course ids as column qualifiers here)Course: course id course data (name,
syllabus,…) students (use student
ids as column qualifiers here)This schema gives you fast access to
the queries,show all classes for a
student (student table,courses
family),or all students for a class
(courses table,students family).
您如何满足这一要求:“给我所有共享至少两门共同课程的学生”?您可以在HBase中构建一个返回该集合的“查询”,还是必须检索所有相关数据并在代码中自行处理?