NoSQL 适合售票 Web 应用程序吗?

发布于 2024-10-11 20:36:34 字数 235 浏览 2 评论 0原文

我想编写一个高度可扩展的 Web 应用程序来销售活动门票。我想使用 NoSQL 数据库,例如 Big Table 或 MongoDB 以及云服务,例如 Google App Engine (GAE) 或 Amazon Elastic Compute Cloud (Amazon EC2)

是否可以使用这种类型的数据库来确保两个客户端无法同时买同一个地方的票?或者我可能必须使用 RDBMS 数据库并忘记 Google App Engine?

I want to write a high scalable web application for selling event tickets. I want to use NoSQL database, like Big Table or MongoDB and Cloud Service like Google App Engine (GAE) or Amazon Elastic Compute Cloud (Amazon EC2)

Is it posible using this type of database to be sure that two client will not be able to buy a ticket for the same place simultaneously? Or may be I will have to use RDBMS database and forget about Google App Engine?

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

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

发布评论

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

评论(4

北座城市 2024-10-18 20:36:35

答案是“也许”。

根据您想要构建的内容,您可以使用本文中的一些技术:
http://kylebanker.com/blog/2010/06/07/ mongodb-库存-交易/

The answer is 'maybe.'

Depending on what you're trying to build, you many be able to use some of the techniques in this post:
http://kylebanker.com/blog/2010/06/07/mongodb-inventory-transactions/

梅窗月明清似水 2024-10-18 20:36:35

使用 get_or_insert 之类的工具,您可以轻松确保两个客户端未在 Google App Engine 上同时接收相同的资源。然而,GAE 和 RDBMS 之间存在很大差异,因此在做出决定之前请务必进一步研究它们。

Using something like get_or_insert you can easily ensure that two clients are not receiving the same resource simultaneously on Google App Engine. However, there are big differences between GAE and a RDBMS, so make sure you study them further before you make a decision.

喜爱纠缠 2024-10-18 20:36:34

GAE 的数据存储区之类的东西仍然可以支持事务语义,例如:

http:// code.google.com/appengine/docs/python/datastore/transactions.html

所以,是的,可以执行您想要执行的操作。 (注意 - GAE 的数据存储并不完全是 NoSQL,因为它使用类似 SQL 的查询。)

Things like GAE's datastore can still support transactional semantics, for example:

http://code.google.com/appengine/docs/python/datastore/transactions.html

So yes, it is possible to do what you're seeking to do. (Note - GAE's Datastore is not exactly NoSQL, since it uses SQL-like queries.)

青巷忧颜 2024-10-18 20:36:34

我对这个问题有疑问。并非所有 NoSQL 数据库都是平等创建的,不同的 NoSQL 数据库存储数据的方式也不同。一般来说,您应该担心的是:数据实际上被写入磁盘,而不仅仅是写入内存。大多数 NoSQL 数据库可以执行此操作,但默认情况下不能。这么说吧,这不是问题,您通常可以告诉像 MOngo 或 Cassandra 这样的数据库将数据写入磁盘,甚至可以告诉至少应该将数据写入多少台服务器。

问题是您可能无法获得真正的交易支持。当您处理电子商务时,重要的是要进行全有或全无类型的交易,其中多个操作要么完全成功,要么回滚。绝对不可能只保存部分数据。例如,如果您需要将数据写入多个表(NoSQL 行话中的集合或文档),如果服务器在该过程中发生故障并且您的数据仅写入一张表,这在电子商务中通常是不可接受的。

我并不熟悉所有的 NoSQL 数据库,但我知道的数据库还没有这个选项。
另一方面,MySQL 确实如此。

如果事务支持或缺乏事务支持并不困扰您,那么我认为使用 NoSQL 就可以,只要您告诉它将数据保存到磁盘而不仅仅是保存到内存中。

I have a problem with this question. Not all NoSQL databases are created equally, and different NoSQL databases have different ways they store data. Generally the thing you should be worried about are: data is actually written to disk and not just into memory. Most NoSQL databases can do this but not by default. Let's just say this is not a problem, you can usually tell the database like MOngo or Cassandra to write data to disk, can even tell how many servers at minimum the data should be written to.

The problem is that you may not get a true transactional support. When you deal with ecommerce it's important to have all or nothing type of transation where several operations either succeed completely or rolled back. There must be absolutely no chance that only part of your data is saved. For example, if you need to write data to more than one table (collection or document in NoSQL lingo), if server goes down in the middle of the process and your data is only written to one table, that's usually unacceptable in ecommerce.

I am not familiar with all NoSQL databases, but the ones I know don't have this option yet.
MySQL, on the other hand, does.

If transactional support or lack of it does not bother you, then I think its OK to use NoSQL as long as you tell it to save data to disk and not just into memory.

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