Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Awesome feature, but why these terrible URLs?

  # Query for category_bin = "armor"
  curl http://127.0.0.1:8098/buckets/loot/index/category_bin/eq/armor
  {"keys":["gauntlet24"]}

  # Query for price_int between 300 and 500
  curl http://127.0.0.1:8098/buckets/loot/index/price_int/range/300/500
  {"keys":["gauntlet24"]}
Why not use URI query parameters for the query parameters?

  /buckets/loot/index?category_bin=armor
  /buckets/loot/index?price_int=[300..500]


Here are two (minor) considerations

1) If you want to be pedantic about HTTP, RFC 2616 states with respect to responses from URIs containing query strings that "caches MUST NOT treat responses to such URIs as fresh unless the server provides an explicit expiration time." Although this clause is broadly ignored by the vast majority of middleware, it could be argued that slashes are more correct. http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13...

2) Middleware like Squid comes with strip_query_terms on by default so if you put Squid in front of a Riak cluster and you wanted to see what was actually being run you'd have to make changes to the config file. Otherwise the request uri in the logs just reads "/buckets/loot/index?"


That is still under debate AFAIK. The latter form would allow you to compose multiple index lookups as well, which is why I'm for it (although the query planner might not support it yet).


What about

  /buckets/loot/index/category_bin,armor/price_int,300,500
Looks a lot like link walk syntax, don't it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: