如何在 SaaS 环境中处理过期的免费帐户

发布于 2024-12-17 10:19:57 字数 707 浏览 2 评论 0原文

这有点哲学,但是,这是场景和相关问题。 假设您出售高级帐户,同时提供限时免费帐户。 用户使用他们的电子邮件地址注册并登录。创建免费帐户不需要移交任何过度敏感的数据(仅电子邮件)。 免费用户有 X 天的时间来评估您的服务,然后升级到高级帐户或看到他们的免费帐户过期。

问题是:如何最好地处理“过期”数据库?

您可以:

1)将该帐户保留在您的全局“用户”表中,将其标记为已过期

  • PRO:用户名/电子邮件始终是唯一的,并且无法重新注册 相同的电子邮件
  • 缺点:无法使用同一电子邮件重新注册(也许 他想要在他感兴趣的新功能之后这样做 添加)
  • PRO:所有帐户都在一个地方,更容易处理统计数据 检索
  • CON:用户表只会随着时间的推移而变得更大

2)删除帐户,可能将其移动到 user_history 或 expired_user 表

  • PRO:您的用户表较小,并且仅包含来自“活动”用户的数据
  • CON:过期的用户名/电子邮件帐户是可重复使用的(您的日志可能会变得混乱,并且您必须始终记录除用户名之外的用户 ID,因为它不再是唯一的)
  • PRO:过期帐户的用户名/电子邮件是可重复使用的(过期帐户)添加新功能后想要再次运行试用的用户可以这样做,而不必被迫选择另一个电子邮件地址)
  • 缺点:用户统计信息收集变得更加复杂

有人遇到过同样的问题吗?

This is a bit philosophical, however, here is the scenario and the related question.
Suppose you sell premium accounts and at the same time offer time-limited free accounts.
Users register and log in using their email address. Creating a free account does not require handing over any overly sensitive data (just the email).
Free users have X days to evaluate your service then either upgrade to a premium account or see their free account expire.

The question is: how to best handle that "expired" database-wise?

You could:

1) keep the account in your global "user" table marking it is as expired

  • PRO: username/email is always unique and one cannot re-register with
    the same email
  • CON: one cannot re-register with the same email (maybe
    he wants to do just that after a new feature he is interested in is
    added)
  • PRO: all accounts are in one place, easier handling of stats
    retrieval
  • CON: user table can only get bigger over time

2) remove the account, possibly moving it to a user_history or expired_user table

  • PRO: your user table is smaller and contains only data from "live" users
  • CON: username/email of an expired account is re-usable (your logs are likely to get messed up, and you have to always log the userID other then the username since that would not be unique anymore)
  • PRO: username/email of an expired account is re-usable (expired users that want to give the trial another run after new features are added can do so without being forced to pick another email address)
  • CON: user stats gathering gets more complicated

Has anyone faced the same problem?

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

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

发布评论

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

评论(2

像极了他 2024-12-24 10:19:57

我建议将架构分成两部分:

TABLE: users
user_id (PK)
email_address
password_hash
....

TABLE: user_status
user_status_id (PK)
user_id (FK)
status_date
status_value

给定帐户的当前状态是具有最新状态日期的状态。
当用户注册“免费”帐户时,您将一条记录插入到 user_status 中,状态值为“new_free_status”;当帐户过期时,您插入一条状态值为“free_account_expired”的记录。您使用状态来检查用户是否可以登录;如果您希望允许人们在其免费帐户上次过期后至少一个月内进行注册,您可以检查用户状态记录以了解其帐户何时关闭。

当然,您可以创建另一个名为“status”的查找表,并连接到具有“account_type”的表 - 这样,您的数据变得更加自描述。

此设计的关键在于您希望将用户配置文件与当前状态分开,并随着时间的推移跟踪该状态。这使您可以回答诸如“有多少人在试用后注册了付费帐户?”、“人们在注册免费帐户之间需要多长时间进行升级?”、“有多少用户回来进行另一次试用?”之类的问题。 ” ETC。

I'd suggest splitting the schema into two:

TABLE: users
user_id (PK)
email_address
password_hash
....

TABLE: user_status
user_status_id (PK)
user_id (FK)
status_date
status_value

The current status of a given account is the one with the latest status date.
When the user signs up for a "free" account, you insert a record into user_status with status value "new_free_status"; when the account expires, you insert a record with status value "free_account_expired". You use the status to check whether a user can log in or not; if you want to allow people to sign up at least one month after their free account last expired, you check the user status record to see when their account was closed.

You can, of course, create another lookup table called "status", and join to a table with "account_type" - that way, your data becomes more self-describing.

The key thing in this design is that you want to separate the user profile from the current status, and keep track of that status over time. This allows you to answer questions like "how many people signed up for a paid account after having a trial?", "how long between signing up for a free account do people upgrade?", "how many users come back for another trial?" etc.

相权↑美人 2024-12-24 10:19:57

拥有太大的用户表应该不是问题 - 存储很便宜,如果索引良好,那就没问题。我目前正在制定一个类似的应用程序,我们只是将所有帐户保留在用户表中。如果用户的试用期超过一个月左右,我们只需让他们再次注册以查看新功能(如果他们愿意),然后重新激活他们的帐户。

当然,由于应用程序的类型,这种策略很有效。您通常会每天使用它;您绝不会使用我们的应用程序几个小时后就再次将其扔掉。这就是为什么它对我们来说有意义,但对 Adob​​e 来说用 Photoshop 来做到这一点却没有意义。

我所说的可能不适用于您的情况,但我(并且我只能假设其他开发人员)认为使用多个表将数据划分为类别是一种不好的做法。使用列和 WHERE 子句来执行此操作,这就是它们的用途。

Having a user table that is too large shouldn't be a problem - storage is cheap, and if it's indexed well, you'll be fine. I'm currently speccing out a similar application, and we're just going to keep all accounts in the user table. If the user has let their trial lapse for more than a month or so, we just let them sign up again to check out the new features if they want, and we just reactivate their account.

This strategy works well of course, because of the type of application. You would typically use it on a daily basis; you'd never use our application for a few hours and throw it away again. This is why it makes sense for us, but it doesn't make sense for Adobe to do this with Photoshop, for example.

What I've said may not apply to your situation, but I (and I can only assume other developers) consider it to be a bad practice to use multiple tables to slice data into categories. Use a column and a WHERE clause to do this, it's what they're for.

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