Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用户登录的Cassandra数据模型:分区和集群密钥混淆_Cassandra_Data Modeling - Fatal编程技术网

用户登录的Cassandra数据模型:分区和集群密钥混淆

用户登录的Cassandra数据模型:分区和集群密钥混淆,cassandra,data-modeling,Cassandra,Data Modeling,我希望用户登录使用电子邮件id或手机号码或用户名。 我是卡桑德拉的新手,谁能给我推荐正确的数据模型呢 我是这样想的 表-用户 userName//将其视为userId PK 电子邮件ID 手机号码 密码 或者我应该创建3个表 -用户名 -密码 -电子邮件ID -密码 -美孚利诺 -密码 另外,我如何从cassandra分区和集群关键概念中获益 提前感谢:)创建三个表- Create table User_by_userid{ username text, email text, mob

我希望用户登录使用电子邮件id或手机号码或用户名。 我是卡桑德拉的新手,谁能给我推荐正确的数据模型呢

我是这样想的

表-用户

  • userName//将其视为userId PK
  • 电子邮件ID
  • 手机号码
  • 密码
或者我应该创建3个表

-用户名 -密码

-电子邮件ID -密码

-美孚利诺 -密码

另外,我如何从cassandra分区和集群关键概念中获益


提前感谢:)

创建三个表-

Create table User_by_userid{
 username text,
 email text,
 mobileno text,
 password
 primary key (username)

 }

   Create table User_by_email{
    username text,
    email text,
    mobileno text,
    password
    primary key (email)

 }

  Create table User_by_mobileno{
    username text,
    email text,
    mobileno text,
    password
    primary key (mobileno)

  }
这将是有效的方法。数据复制在Cassandra数据建模时非常有用。Cassandra是写密集型数据库。写字很便宜。 您需要在创建用户时启用应用程序级锁定,您需要通过电子邮件/uname/mobile编号检查用户是否存在。这是检查然后执行操作的情况