【问题标题】:How to authenticate a user using Cassandra database如何使用 Cassandra 数据库对用户进行身份验证
【发布时间】:2013-02-24 01:52:24
【问题描述】:

我想创建一种对用户进行身份验证的方法。在 mysql 我做:

SELECT user_id FROM customers WHERE `username` = 'the_username' AND `password` = 'the_password' 

如果查询未返回空结果集,则用户已获得授权。 Cassandra 希望我预先知道行键 (user_id)。如何检查列族中的所有行是否存在我不知道行键的用户名和密码。

我正在使用 Hector api 连接到 Cassandra 1.2.2

【问题讨论】:

    标签: java cassandra hector


    【解决方案1】:

    一些可能的解决方案:

    1. 使用用户名作为行键
    2. 在用户名上创建二级索引

    我会使用第一个。如果用户名是唯一的(我假设),则不需要 user_id

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-05
      • 2013-06-27
      相关资源
      最近更新 更多