pynamodb / PynamoDB

A pythonic interface to Amazon's DynamoDB
http://pynamodb.readthedocs.io
MIT License
2.44k stars 427 forks source link

support for Model.create_table() to create a table with default autoscaling capacity #417

Open devangmehta123 opened 6 years ago

devangmehta123 commented 6 years ago

I have tried Model.create_table() in version 3.2 without setting read_capacity_units and write_capacity_units. pynamo throws an exception that saying that it needs ints between 1-inf for these.

But I was hoping that it would create the tables with the default AWS autoscale settings which apply when you manually create the table through the console.

And to me it seems to be a very useful feature addition which could hlep many users of pynamodb.

If there is a workaround, please let me know.

dmulter commented 6 years ago

I'm actually just looking for support of the new auto-scaling feature. I assume there would be new Meta fields for controlling read/write scaling and the associated parameters.

aleph0ne commented 6 years ago

Any update on this issue? I would very much like to create a table from pynamodb with autoscaling enabled by default.

dhruvsakalley commented 6 years ago

It'll be interesting to be able to manage dynamodb scaling even post creation. I'm ingesting large data files into dynamodb and then reducing capacity to apply autoscaling later. I wonder how the update scenarios will be handled here. Unfortunately though the boto client for dynamodb does not support autoscaling, you have to do that using application-autoscaling client, which is even more verbose. https://boto3.readthedocs.io/en/latest/reference/services/application-autoscaling.html

andreborges-janrain commented 6 years ago

Any news about that?

Seluj78 commented 5 years ago

Ping ?

ikonst commented 5 years ago

I think right now our story for provisioning and reprovisioning tables with PynamoDB on actual AWS DynamoDB is pretty weak.

We're using PynamoDB at Lyft, and within Lyft we effectively only use PynamoDB's create_table in development against dynamodb-local and dynalite, while our production provisioning is done with Terraform. I suspect many organizations are similar, but I'll be happy to hear more perspectives.

Seluj78 commented 5 years ago

Well same here @ikonst, just that I was wondering if it would be possible to have an option in create_table to set the auto scaling parametters like in the console

Screenshot 2019-08-14 at 20 33 34
ikonst commented 5 years ago

@Seluj78 What I'm asking is how is it useful to you? Are you provisioning production tables with PynamoDB?

Seluj78 commented 5 years ago

@ikonst this is totally going to look dumb but I forgot why I needed it... So nvm I guess, my bad 😖

Seluj78 commented 5 years ago

But no I am not

rblakemesser commented 1 year ago

I'd definitely like to be able to provision production tables this way fwiw

monkut commented 1 year ago

Yes, if we have read_capacity_units and write_capacity_units settings in Meta, it would be helpful to have auto-scale capability as well.

    class Meta:
        read_capacity_units = 2  # with auto-scale use as minimum?
        max_read_capacity_units = 10
        write_capacity_units = 2  # with auto-scale use as minimum?
        max_write_capacity_units = 10  

Is there any down side to setting the auto-scale configuration? If not, maybe default max_read_capacity_units to read_capacity_units, and if given use that value?