What changes do I need for my tables to work on AppEngine's BigTable?

核能气质少年 提交于 2019-12-03 08:43:22

What changes you need depends mostly on what queries you need to run, not on what data you have. Most likely you will only have to add a couple of things.

Make a list of queries and then take a look at Restrictions on Queries. After you've found the problematic ones, try to rewrite them with BigTable's constraints in mind.

For example, if you often need to find the number of tickets for a list of flights, you won't just be able to do:

SELECT
    flight_no, COUNT(*)
FROM
    flights
JOIN
    tickets ON tickets.flight_no = flights.flight_no
GROUP BY
    flight_no

So you'll need to add a counter of tickets to flights and increment/decrement that when creating/deleting tickets.

Good side of this is that BigTable forces you to have a very scalable database design. Bad side is that it wastes a lot of your time when you don't really need a scalable design.

You can use genuine SQL relational databases from Google appengine apps, through a webservice.

One such webservice is Rdbhost, at http://www.rdbhost.com .

It involves its compromises, particularly speed, in that each page view requires another backend http page request to the db server, but it allows you to use the SQL design knowledge you already have.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!