数据存储模拟器 Query/Issue

Datastore Emulator Query/Issue

我已经在我的本地机器上安装了 google 数据存储模拟器,并编写了一个示例 spring 启动应用程序,该应用程序在数据存储上执行 crud 操作。 当我通过邮递员访问其余端点时,我实际上可以看到数据被插入到 gcp 控制台的数据存储中

谁能帮助我解决以下问题:

1>即使在本地使用模拟器,数据是否被插入到云中的实际数据存储 (gcp)

2>模拟器的用途是什么(如果 qn 1 正确)

  1. Datastore 服务器上没有插入任何数据,如前所述,所有内容都是本地的here

The emulator simulates Datastore by creating /WEB-INF/appengine-generated/local_db.bin in a specified data directory and storing data in local_db.bin. By default, the emulator uses the data directory ~/.config/gcloud/emulators/datastore/. The local_db.bin file persists between sessions of the emulator. You can set up multiple data directories and think of each as a separate, local Datastore mode instance. To clear the contents of a local_db.bin file, stop the emulator and manually delete the file.

  1. 有多种用途例如:
  • 在本地开发和测试您的应用程序,无需将实际数据写入服务器,从而避免在开发过程中产生费用
  • 帮助您在 Datastore 模式实例中为生产 Firestore 生成索引并删除不需要的索引,这可能是 exported 然后进入生产

编辑

为了在同一台机器上使用模拟器,建议按照 documentation

中所述自动设置环境变量