User guide
Additional Resources
For additional information and examples of programming JSON with DynamoDB with the SDK for .NET,
see:
• DynamoDB JSON Support
• Amazon DynamoDB Update - JSON, Expanded Free Tier, Flexible Scaling, Larger Items
Managing ASP.NET Session State with Amazon
DynamoDB
ASP.NET applications often store session-state data in memory. However, this approach doesn't scale
well. Once the application grows beyond a single web server, the session state must be shared between
servers. A common solution is to set up a dedicated session-state server with Microsoft SQL Server. But
this approach also has drawbacks: you must administer another machine, the session-state server is a
single point of failure, and the session-state server itself can become a performance bottleneck.
Amazon DynamoDB, a NoSQL database store from Amazon Web Services (AWS), provides an effective
solution for sharing session-state across web servers without incurring any of these drawbacks.
Note
Regardless of the solution you choose, be aware that Amazon DynamoDB enforces an item
size limit of 64 KB. None of the records that you store in DynamoDB can exceed this limit.
The AWS SDK for .NET includes AWS.SessionProvider.dll, which contains an ASP.NET session
state provider. Also included is the AmazonDynamoDBSessionProviderSample sample, which demonstrates
how to use Amazon DynamoDB as a session-state provider.
For more information about using Session State with ASP.NET applications, go to the MSDN
documentation.
Create the ASP.NET_SessionState Table
When your application starts, it looks for an Amazon DynamoDB table named, by default,
ASP.NET_SessionState. We recommend that you create this table before you run your application for
the first time.
To create the ASP.NET_SessionState table
1. Sign in to the AWS Management Console and open the DynamoDB console at https://
console.aws.amazon.com/dynamodb/.
2. Click Create Table.The Create Table wizard opens.
a. In the Table Name text box, enter this text: ASP.NET_SessionState
b. In the Primary Key Type field, click Hash.
c. In the Hash Attribute Name text box, enter this text: SessionId
When all your options are entered as you want them, click Continue.
3. On the Add Indexes page, click Continue.
4. On the Provisioned Throughput Capacity page, enter the number of Read Capacity Units and
Write Capacity Units you want for the table.
Version v2.0.0
65
AWS SDK for .NET Developer Guide
Managing ASP.NET Session State with Amazon
DynamoDB