简体   繁体   English

Google App Engine Python中是否有等效的SQL View?

[英]Is there an equivalent of a SQL View in Google App Engine Python?

I've been learning python by building a webapp on google app engine over the past five or six months. 在过去的五到六个月里,我一直在通过在Google App引擎上构建Web应用程序来学习python。 I also just finished taking a databases class this semester where I learned about views, and their benefits. 本学期我还刚刚完成了数据库课程,在那里我了解了视图及其好处。

Is there an equivalent with the GAE datastore using python? 使用python的GAE数据存储是否等效?

Read-only views (the most common type) are basically queries against one or more tables to present the illusion of new tables. 只读视图(最常见的类型)基本上是针对一个或多个表的查询,以呈现新表的错觉。 If you took a college-level database course, you probably learned about relational databases, and I'm guessing you're looking for something like relational views. 如果您上了一门大学级别的数据库课程,您可能已经了解了关系数据库,而且我猜您正在寻找诸如关系视图之类的东西。

The short answer is No. 最简洁的答案是不。

The GAE datastore is non-relational. GAE数据存储区是非关系的。 It doesn't have tables. 它没有桌子。 It's essentially a very large distributed hash table that uses composite keys to present the (very useful) illusion of Entities, which are easy at first glance to mistake for rows in a relational database. 从本质上讲,它是一个非常大的分布式哈希表,它使用复合键来表示(非常有用的)实体错觉,乍一看很容易就误认为关系数据库中的行。

The longer answer depends on what you'd do if you had a view. 更长的答案取决于您的看法。

First of all answer to your question: With normal GAE, ie non relational DB GAE, you won't have such things as views 首先回答您的问题:使用普通GAE,即非关系数据库GAE,您将不会有诸如视图之类的东西

Since you are probably starting with Relational SQL in school, I would suggest switch to Relational SQL based GAE at http://code.google.com/apis/sql/ and http://code.google.com/apis/sql/docs/before_you_begin.html#enroll ( I am not sure if it's available right away, or you need to wait for approval to use an instance, but register right away) 由于您可能在学校开始使用关系SQL,因此建议您在http://code.google.com/apis/sql/http://code.google.com/apis/sql/上切换到基于关系SQL的GAE docs / before_you_begin.html#enroll (我不确定它是否立即可用,或者您需要等待批准才能使用实例,但立即注册)

Web based applications are using emerging NON relational DBs and you would be benefited by studying them as well. 基于Web的应用程序正在使用新兴的NON关系数据库,研究它们也会使您受益。 That way you also could understand GAE non relational better. 这样,您还可以更好地了解GAE非关系。 As a basic level start at http://en.wikipedia.org/wiki/NoSQL and then you have many more to explore, specially famous once being Mongo DB, Amazon Simple DB etc. http://en.wikipedia.org/wiki/NoSQL开始,作为一个基本级别,然后您将有更多值得探索的地方,特别著名的是Mongo DB,Amazon Simple DB等。

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

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