从 Redis 迁移到 Memorystore

Migrate from Redis to Memorystore

目前我们正在使用 C++ 的 hiredis-vip 客户端库来连接 Redis 实例。

Memorystore 文档说 Redis 的所有现有工具和客户端库都可以与 Memorystore 一起使用。那么,我现有的 C++ 代码是否可以在不进行任何代码更改的情况下与 Memorystore 一起使用?

Memorystore for Redis documentation 中所述,您可以将使用开源 Redis 的应用程序移动到使用 Memorystore for Redis,而无需更改任何代码。

不过,也许好的方法是(取决于您的具体用例),并在 best practices, by following this documentation regarding "how to monitor instances with Cloud Monitoring".

中指定

我能够使用 Memorystore 验证 C/C++ 客户端库的可用性。在同一区域和地区启动 GCE 实例和 Memorystore。然后我在GCE上安装了hiredis-vip客户端库,编译构建了示例代码。

参考。代码。 https://github.com/vipshop/hiredis-vip/blob/master/examples/example.c

您可以在网上找到有关库安装和C/C++代码编译和构建过程的参考资料。我只需要修改IP地址。这段代码运行完美无缺。因此,事实证明,我们可以将使用开源 Redis 的应用程序迁移到使用 Memorystore for Redis,而无需更改任何代码。