Client Library for Cloud Datastore on App Engine - NDB or google-cloud-datastore

前端 未结 1 1830
囚心锁ツ
囚心锁ツ 2021-02-11 06:24

Per Google\'s documentation, it seems like I have two main options for connecting to Datastore using Python: App Engine\'s NDB Datastore library, and the Google Cloud Datastore

1条回答
  •  生来不讨喜
    2021-02-11 06:34

    Following some more reading, I'm going to go ahead and answer my own questions, hopefully for the benefit of others.

    After reading the discussion on google-cloud-python in full, many of my questions can be answered with some degree of confidence.

    First, it seems that the opinion of the developers on the project is that Google Cloud Datastore API should work on App Engine, but that the performance will be worse than NDB. This is certainly a reason to use NDB over the Datastore API on App Engine.

    Second, it sounds like the developers consider NDB to be both complex and quite mature, and seem to unanimously support its eventual inclusion in the Cloud Datastore python library. Thus, it doesn't seem likely that NDB will be discontinued. Most likely, it may just eventually need to be included from the broader gcloud set of libraries.

    Third, the devs are indicating that NDB support beyond App Engine is being actively developed, so if my project moves beyond App Engine, NDB may already be available on further environments by then, so no switch to the Cloud Datastore API will be required. Besides, the next step beyond standard App Engine is the Flexible Environment, which seems to already support NDB nicely.

    All this to say that I should be clear to move ahead with NDB, benefiting from its better performance and ORM capabilities on App Engine, and unless Google's opinions/directions on the matter change in the future, I'll most likely have the option to continue using NDB in other environments on the Google Cloud. I'm going to use NDB and look forward to its eventual inclusion into google-cloud-python.

    If anyone has any additional experience with the matter, I'd love to hear your thoughts.

    0 讨论(0)
提交回复
热议问题