1週間前にCloud Datastoreのクエリでがんばるハナシという記事を書きましたが、そこで書いた各種テクニックをサポートするライブラリを作ったので紹介します。 XIAN 注意: 現時点でまだβ版(v0.1.0)です。正式版の前に後方互換のない修正が入る可能性があります モチベーション Search APIあまり使いたくない Datastoreクエリの不足する機能を補う為にSearch APIを併用するテクニックがあります。 Search APIはとても便利ですがいくつかの制限があり、何よりインデックスサイズに上限がある為スケーラビリティに難があります。 参照: GAEでハマったこと(´・ω・`) Search APIに出来るだけ頼らないことが本ライブラリの第一の目的です。 LIKEやINを使いたい Cloud DatastoreはLIKEやIN/OR条件のフィルタをサポートしません。
GAE(Standard Environment)で動作するWebアプリケーションをGoで書いている。サインアップしたユーザーの情報などを永続化しようとした場合、GAE で素直にやるとすると Datastore を使うことになる。昔 Java で GAE アプリケーションを書いていたときには Slim3 というフレームワークを使って Datastore に対する操作をおこなっていたが、現代・Goで、となると「これかな」と思っていたのが、mercari/datastore。 github.com 自分の言葉で「つらい」といえるほど、標準ライブラリでの datastore 操作をやってきたわけではないし、その他のなにかと比べてみたわけでもない。......のだけど、GAEに強いあんな人やこんな人が集まるメルカリ謹製のラッパーなら大丈夫なんだろう、ということで、いったんはこれを使って開発を進めて
僕の Datastore の記事は Cloud Datastore/AppEngine Datastore 時代のものなので、現在の Firestore の Datastore mode だと一部の内容が正しくないと思うので注意してください。(´・ω・`)— pospome (@pospome) March 24, 2021 Datastoreを使っていて、 ある程度コツとか注意点みたいなものが分かってきたので、 まとめてみました。 継続的に追記していく予定です。 間違っているところがあれば コメント or twitter で教えてください。 Datastoreの entity, kind などの用語は理解している前提です。 ParentKeyに気をつける Go では Filter による OR, IN 検索ができない 文字列に対する LIKE 検索がない 結局どんなクエリが発行できるのか
ソウゾウ社の社内勉強会Go Friday 第60回用の資料です。 本来Go Fridayでは資料作ったりとかの事前準備はせんでええわいということになってるんですが素手で「ええやんこれ〜〜」という感想を引き出せる気がしなかったので作りました。 go.mercari.io/datastoreの話です。 今日話すこと なぜ最強なのか。いかにして最強なのか。これからの最強。 ほしい理由 解決方法 実装方法(めんどいのでGo Friday中で口頭で説明) 設計上の判断と移行の注意点 これから実装する機能 Datastoreって何? Googleのやつ。 appengineユーザなら誰しもお世話になってるはず。 ラッパがほしい理由 つらいこととかめんどくさいこととかが色々ありそれを解消したい。 →よろしい!ならば自分でラッパーを作るしかない! つらポイント1 type PropertyLoadSave
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く