24

Background: I'm creating kind of simplified pseudo-ORM for use in Django. Classes obviously use CamelCase convention, while Django app is underscored lowercase. Which leaves me with a few options:

  • Django ORM style: app_name_someclass
  • proper underscore style: app_name_some_class
  • as-is: app_name.SomeClass
  • possibly some other using different separators etc.

Are there any well established naming conventions for DynamoDB? So far, from what I've seen in examples, it seems that it's free-for-all.

vartec
  • 131,205
  • 36
  • 218
  • 244
  • 4
    kinda late now but anyone looking at this question can look at the official AWS documentation with example Tables and Data https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/AppendixSampleTables.html – chris Dec 14 '20 at 01:49
  • @chris so PascalCase – jpell Dec 23 '21 at 14:59

2 Answers2

17

Following the examples in the AWS documentation here and here would lead to the following conventions:

  1. Table names in Pascal Case (Upper Camel Case), e.g. MyTable.
  2. Attribute names also in Pascal Case, e.g. Id, ProductCategory etc.

Actually the examples are a bit inconsistent when it comes to acronym capitalization - with ISBN and Id in the first link and both CustomerID and CustomerId in the second link. Either style could be argued but I'd personally lean towards only capitalizing the first letter in an acronym. See here for more debate on this subject.

Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
7

It's free for all. I name tables as "users", "secret-files", "seen-blog-posts", and their attributes as "user.name", "date.recent.iso", etc.

yegor256
  • 102,010
  • 123
  • 446
  • 597