Search code examples
pythongoogle-app-enginegoogle-cloud-platformgoogle-cloud-datastoregoogle-cloud-python

How is ndb (and cloud datastore) being used in the firebase tic-tac-toe example


In the google app engine firebase tic-tac-toe example here: https://cloud.google.com/solutions/using-firebase-real-time-events-app-engine

nbd is used to create the Game data model. This model is used in the code to store the state of the tic-tac-toe game. I thought nbd was used to store data in Cloud Datastore, but, as far as I can tell, nothing is being stored in the Cloud Datastore of the associated google cloud project. I think this is because I am launching the app in 'dev mode' with python dev_appserver.py app.yaml In this case, is the data being stored in memory instead of actually being written to cloud datastore?


Solution

  • You're correct, running the application locally is using a datastore emulation, contained inside dev_appserver.py.

    The data is not stored in memory, but on the local disk. So even if the development server restarts it will still find the "datastore" data written in a previous execution.

    You can check the data actually saved using the local development server's admin interface at http://localhost:8000/datastore