Skip to content

Instantly share code, notes, and snippets.

@taichi
Created May 30, 2012 07:55
Show Gist options
  • Save taichi/2834442 to your computer and use it in GitHub Desktop.
Save taichi/2834442 to your computer and use it in GitHub Desktop.
some suggestion to riak.

RpbErrorResp の errcode はより適切な値が設定されるべきである。

PBC API ではエラーが起きると、RpbErrorRespが返るがRIAKC_ERR_GENERALが常に設定されており意味がないのでREST APIと同等の値が設定されているべきです。

例えば、get operation において、notfound が返るのは多くの場合クライアント側にとって特に問題ないので、コストの高い例外処理がトリガーされない事が望ましい。
一方で、modifiedが返る場合、データのリペアをトリガするべきか、単に再度getするべきかはアプリケーションの設計の問題である。

errmsgフィールドの様にHumanReadableなフィールドはあくまでも人間にとって分かり易い事が大切であり、その内容は長い開発期間の中で微調整されるべきであり、不安定でも仕方のないものである。
きめ細かい例外処理を実現する場合、errcode フィールドを読み取って処理するべきなので、現状のPBC API実装は望ましくない。

REST API が持つ便利な機能をPBC APIにも実装するべきである。

速度を何にも増して重視するユーザは全ての処理をPBC APIでやりたいと考えるだろう。
しかし、幾つかのAPI差分が存在する事によって全てをPBC APIで賄う事が出来ない。

Backet Properties of PBC API should have more field

PBC API ではBacket Propertiesに対するアクセスが著しく制限されており、これはつまり事実上Backetの管理はREST APIでしか行い得ないという事であり、これは望ましくない。

ある種のアプリケーションではエンドユーザ単位にBacketを作る、つまり大量のBacketを作っては捨てる事でアプリケーションの作りがシンプルで強力になるケースがある。

PBC API should support Link Walking

Link Walking は非常に便利な機能であるのにPBC APIから使えないのは非常に残念な事だ。

PBC API の RpbGetServerInfoResp は、REST API の/statsと同じ情報を返すべきだ。

RpbGetServerInfoRespは貧弱すぎて全く使い物にならない。
/statsの中にはクライアントがRiakと自立協調動作する為に必要な多くの情報を含んでいる。
クライアントが高速に動作する事を望むPBC APIのユーザこそがこれらの情報を望んでいる筈だ。

参考情報

@shiumachi
Copy link

とりあえず最初のセクションだけ訳しました

RpbErrorResp errcode should be set more proper value

Once error occurs on PBC API, RpbErrorResp is returned but it doesn't make sense because RIAKC_ERR_GENERAL is enable. It should be set the same value to REST API.

It doesn't matter for client if server returns not found on GET operation. So heavy performance cost exception should not be triggered. If modified is returned, application should choose to trigger to repair data or just to retry get ops. It's not server-side issue.

All human readable fields e.g. errmsg field should be understandable for user. The contents should be tuned in long development cycle, so instabliy in early release is acceptable. If we requires detailed implementation on error handling, it should be done by reading errcode field.
I suggest we improve current version of PBC API.

@shiumachi
Copy link

すいませんラスト一箇所 typo してました。
s/instabliy/instability/

@shiumachi
Copy link

残りも書きました

Some useful REST API features should be implemented on PBC API
Ibelieve all users who need s more performance would like to process all operations via PBC API.
However, user cannot do so due to lack of some APIs.

Backet Properrties of PBC API should have more fields
PBC API is strictly limited to access to Backet Properties. That is, we have to use REST API for Backet management.

Some applications creates per-user Backets. This indicates that we can write much simpler and faster application by creating/deleting a large amount of Backets.

PBC API should support Link Walking
It would be great if we could use Link Walking, which is really useful feature.

PBC API RpbGetServerInfoResp should return the same information to REST API /stats
RpbGetServerInfoResp returns so poor information that we can't use this API at all
/stats includes many useful information which is required for client to coordinate with Riak.
PBC API user who wants fast client needs this information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment