Fork me on GitHub
Nick Cellino15:09:34

hey all, I just posted this little example of an nbb project running on Lambda (using serverless framework) and interacting with DynamoDB. There’s some code in there working with the AWS JS v3 SDK for dynamodb if it’s of any interest 🙂 I’d love to hear any feedback anyone has on the code or writing! edit: here’s the link to the repo if you wanna skip right to the code

👍 3

Nice project! In JS v3 sdk they don’t seem to have DocumentClient for DynamoDB anymore, but they’ve included the utils to marshall from dynamodb-JSON to “normal” JSON and the other way around.


Just quickly skimmed through the code. 🙂 Tomorrow I might have time to actually try it out!

Nick Cellino19:09:31

hey, thanks! Looks like that would take some of the manual work out of this kind of stuff that I’m doing, right?

(defn build-dynamo-comment-payload
  {:PostId {:S (:post-id comment-input)}
   :CommentId {:S (uuid/v4)}
   :Message {:S (:message comment-input)}
   :Time {:S (.toISOString (js/Date.))}
   :Author {:S (:author comment-input)}
   :RecaptchaScore {:S (str (:score comment-input))}})


Yep, exactly. 🙂

Nick Cellino19:09:53

very nice, didn’t know about that


Yeh, it’s pretty well hidden!

Nick Cellino19:09:12

yeah there’s definitely a lot in those sdks to dig through


I remember it was PITA to add those type attributes.. then I found out that DocumentClient does that automatically. But now they don’t have DocumentClient in v3 which got me confused but luckily they’ve kept the supporting functions around.


Weird that they don’t mention it in the DynamoDB Client README. :thinking_face: I guess 99% of the SDK users would like to use those functions if they knew they existed

Nick Cellino19:09:07

that’s good. we actually have some DynamoDB code that we use at my day job in plain old JS and whoever wrote it definitely did not know about these utils. We have that crazy nested { "Field": { "S": "Value" } } type stuff all over the place lol


I guess it’s all generated (code, docs, references) and these weird things on the side get excluded

Nick Cellino19:09:37

yeah i guess that makes sense. I’ve looked into that a little bit (not too deeply), but i think it’s pretty amazing how they basically describe all of their apis for all of their services in some generic way and autogenerate all the stuff that they do

Nick Cellino19:09:51

i’m kind of in awe of aws

🙂 1

Personally I like their engineering. They have quite clojurey mindset to not break things.


One thing they don’t know how to do is UI’s 😄


OTOH also GCP and Azure have very crappy UI’s

Nick Cellino19:09:38

i really like it too. it’s very “DIY” which was/is pretty painful sometimes, but I appreciate the transparency of everything

Nick Cellino19:09:22

agreed on the UIs too haha. i try to do everything i can using infra-as-code but i spend time in the UI when prototyping things. but eh, they serve their purpose for me most of the time


Yep, I usually explore in the UI and when I know what I want I write it in Cloudformation


Which is always a journey 😎

Nick Cellino20:09:24

i know what you mean 😆