简体   繁体   English

PynamoDB 是否支持 AWS DAX?

[英]Do PynamoDB support AWS DAX?

I am using PynamoDB for accessing my AWS DynamoDB tables, Now I need to implement the caching via AWS DAX .我正在使用 PynamoDB 访问我的 AWS DynamoDB 表,现在我需要通过AWS DAX实现缓存。

Does PynamoDB support DAX , even if some source code changes are required to make it work , I can do it myself too. PynamoDB 是否支持 DAX,即使需要更改一些源代码才能使其工作,我也可以自己完成。 Kindly guide me accordingly.请相应地指导我。

I forked from uncovertruth/PynamoDB which added the support for DAX.我从uncovertruth/PynamoDB分叉,它增加了对DAX 的支持。 you can install it with你可以安装它

pip install dynamodb-dax

usage example here使用示例在这里

class CacheModel(Model):
    """
    A DynamoDB Caching table
    """
    class Meta:
        table_name = "cachingDax"
        region = 'us-east-1'
        dax_read_endpoints = ['example.cache.amazonaws.com:8111']
        dax_write_endpoints = ['example.cache.amazonaws.com:8111']
    cacheKey = UnicodeAttribute(hash_key=True)
    data = JSONAttribute(default={})

Note:笔记:

  • The dax endpoints must be a list of strings dax 端点必须是字符串列表
  • You must be in the same VPC as the Dax cluster您必须与 Dax 集群在同一 VPC 中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM