简体   繁体   English

在两个数据库上运行查询

[英]Running queries on two databases

Let say I am building a bookstore for all the books in a library. 假设我正在为图书馆中的所有书籍建立书店。 People won't be buying these books, only renting them for so long. 人们不会买这些书,只会租那么长时间。

They will have to create an account and the proceed to make a rental. 他们将必须创建一个帐户,然后进行租金。 What I want to know is, what would stop some random person from a different city let say, making an account and renting all the books at once?(like a hack or a prank) I have come up with one solution where as to make the users only allowed to rent out one book per a certain time period, but then someone will could just make 100+ accounts if they so wish. 我想知道的是,是什么会阻止某个来自其他城市的随机人说,做一个帐户并一次租借所有书籍?(例如骇客或恶作剧),我想出了一种解决方案用户只允许在特定时间段内租借一本书,但是如果有人愿意的话,某人将只能创建100多个帐户。

Could you only allow people to create an account who matches a certain criteria in another database(say user database) with there name, email and usernames? 您能否只允许人们创建一个名称,电子邮件和用户名与另一个数据库(例如用户数据库)中的特定条件匹配的帐户? So that no one can just randomly make an account, only people who are already in a different database? 这样一来,没有人可以随机创建一个帐户,只有已经在不同数据库中的人可以注册一个帐户吗?

Well, you just can't avoid other people create many account, but you can limit some things. 好吧,您只是无法避免其他人创建许多帐户,但是您可以限制某些事情。

For example 例如

1- Check the user IP address. 1-检查用户IP地址。
2- Avoid one person can rent more than one book. 2-避免一个人可以租多本书籍。
3- When you rent a book, you can get a DNI or some document that is unique. 3-当您租借书籍时,可以获得DNI或某些唯一的文档。

Those, just are some examples, but how i told you, you can't control it. 这些只是一些示例,但是我如何告诉您,您无法控制它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM