If your primary case is restaurant search, embed and index all necessary data. This will be the fastest solution and easiest to work with
On Appengine extra data doesn't cost you unless it's indexed. There is a careful balance between optimising for speed, cost and transactional integrity. My advice is if this is your first go, expect to make mistakes and to need to reengineer your data a couple of times. Make that process as easy as possible.
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/04705cc7-3673-4d82-984a-61c64b099fe8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Sunday, August 16, 2015, Sanket More <sanke...@gmail.com> wrote:Hey Nick!
After I submitted my question, I went through lots of information sources and gathered some information.
I feel like my question was based on many misconceptions about google app engine's datastore.
I think I have a strategy for the restaurant problem.
The user will provide me with country, state, city and the restaurant name, And I will provide the user with location(s).
So all I really need is one specific entity and the response will simply be the information in that entity.
And, I don't really need to index country, state, city, and restaurant name with each other independently. I just need one string that holds the country state city and restaurant.
In fact, I think that string is unique.
So, I am thinking about having a restaurant kind with key string "country_state_city_restaurant"
Once the user has finished submitting the form, I can get by "country_state_city_restaurant" and return some information to the user.
I wanted a smarter solution than this, because I feel that this solution won't scale well.
Furthermore, if I am flattening my tree structure like this, wouldn't gql be faster?
On Sunday, August 16, 2015 at 4:14:33 PM UTC-7, Nick wrote:The general rule is optimize for your primary use case, denormalise to support others.
In addition, enforce and support constraints In your code.If your primary case is restaurant search, embed and index all necessary data. This will be the fastest solution and easiest to work with
On Appengine extra data doesn't cost you unless it's indexed. There is a careful balance between optimising for speed, cost and transactional integrity. My advice is if this is your first go, expect to make mistakes and to need to reengineer your data a couple of times. Make that process as easy as possible.
Just a suggestion - have you thought about letting the user query through the Google maps or similar API to find the restaurants and then based on those results returning information from your app? These location based queries are hard - both technically and from matching the users expectations. Especially as I'm betting that the city that a user thinks a restaurant is located in often differs from official addresses, especially in large cities.This strategy could let you both control the user experience and leverage the hard work of others.Karl
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
You're attempting to store information which at some point will be queryable on a wide variety of criteria, from spatially, cuisines, partial names matches etc. I would design a solution that respects these potential problems, but doesn't necessarily cater for them.
Assuming you're building a product that succeeds, it's a fair assumption you'll end up using elastic search (or something similar) at the end of the day.
A good bridging gap for this is the full text search API, but it does have severe limitations which you will outgrow. You'll probably hack around them for a while first to keep your architecture with minimal moving pieces.
I can almost guarantee you'll hit the edges of an indexed datastore entity very quickly. Composite keys are a killer for complexity, and will be required on any faceted search as soon as you permit sorting.
I have actually done this before (specifically restaurant search), I was able to make assumptions about the locations based on the user, so they only had to supply suburb name.
With a discrete list of cuisines and interesting factors (vegetarian, disabled access etc) the search api was enough.
Introducing distance (restaurants within 10km of me) it was not, so that was the cutover point.