title: DynamoDB Attribute vs Document
body: <p>I'm trying to study and use DynamoDB.</p>
  <p>I'll use a DynamoDB with a Java SpringBoot microservice.</p>
  <p>I notest that here there is the possibility to store Attributes and Documents.</p>
  <p>I'm not sure that I understood the real best practice to use the Document field. I mean:</p>
  <p>On AWS SDK there is the possibility to annotate an entity field as @Document and the content will be stored as JSON.</p>
  <p>When is it better to use this approach instead of using multiple Attributes (one for each contained field).</p>
  <p>Suppose that in my table I'll have several fields: some of them will be used for queries (PK, SK, and additional attributes that I'll use for indexes). The remain attributes could be filled or not or, for example, suppose that I'll use a not fixed structure of my Items:</p>
  <pre><code>Item A: pk, sk, attribute1, and attribute_a, attribute_b
  Item B: pk, sk, attribute1, and attribute_b, attribute_d
  Item C: pk, sk, attribute1, and attribute_c
  </code></pre>
  <p>In this scenario is it a best practice to store these attributes into a Document field? I don't need to create indexes or queries for them.</p>