A DM-based database for twitterbots on AWS Lambda

  1. Bad idea: just check for tweets sent in the last two minutes
    This will miss tweets that were just over two minutes old (but that your last poll missed), and you’ll never get tweets back on any failed runs.
  2. Good idea: use DynamoDB to store the last-seen tweet
    You just need to store one value here, so you’ll likely stay in the free tier
  3. Best idea: use DMs as your database
    No fancy setup required, works just as well locally as on AWS, no credentials to share, and best of all, it’s as absurd as our president.
  1. Does the easy thing, not the right thing
    Uses the existing infrastructure for your TwitterBot
  2. You don’t need to learn anything new
    No additional services needed, no additional setup needed
  3. Slow and inefficient
    Rather than using hyperoptimized AWS database services or key/value stores, where you can override data and not increase storage costs, you instead have an infinitely growing list (until the president stops tweeting) and a Twitter API roundtrip to read a single value

--

--

--

Building products using computer graphics and data visualizations. Ranked-Choice Voting enthusiast. Pittsburgh, PA.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

D3 Step-by-step Guide — (Part 4 of 4) Singapore HDB Resale Price on Planning Map — GitHub Pages

Introducing 1inch v2 — DeFi’s fastest and most advanced aggregation protocol

Introducing 1inch v2 — DeFi’s fastest and most advanced aggregation protocol

Leetcode — First Bad Version — Easy

A productive command-line Git workflow for indie app developers

Hello World.

10 Top Selenium WebDriver Commands For Test Automation

ANSIBLE TOWER AND ITS INDUSTRY USE CASE

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Armin Samii

Armin Samii

Building products using computer graphics and data visualizations. Ranked-Choice Voting enthusiast. Pittsburgh, PA.

More from Medium

How to attach IAM policies to users on AWS as temporary?

Serverless the savior

Hercules

How to set up CloudFront on AWS and optimize data transfer

Cost Optimization | AWS Non-Prod Infra