Skip to content

Bye-bye, Disqus! I built my commenting system using AWS serverless stack and Netlify build hooks!

I’ve been using Disqus on this website since its inception. It worked and it didn’t cost me a single penny, but it cost me and most importantly my visitors compromised privacy. Since Zeta Global acquired the Disqus in 2017, things became even worse. To top it off, it is also a performance killer.

I started looking into alternatives, and surprisingly there’s not a lot of things worth recommending. Commento and Hyvor Talk look great, but it costs more than Apple Music or Netflix subscription. I’m sure they are worth it but I couldn’t justify paying this price to let someone leave a sentence or two under my posts.

I’m not that bad with HTML. I quite enjoy writing CSS, JavaScript pays my bills and I can find my way through a few AWS services. Yes, you guessed it — I built my own one.

Privacy first #

I don’t want to show you ads, I don’t care about your location and I don’t care about your email address. The only thing I care about is a meaningful conversation under my articles. Kindly introduce yourself by filling the “Name” field (it doesn’t have to be real) and participate in a conversation with others. If you fancy some nasty comments, please save you and me some time and go to Reddit instead.

Performance #

Disqus makes exactly 76 HTTP requests on load, and 11 of these resources are third-party trackers. It loads almost 2MB of data! To top it off, you have to wait around 10 seconds on average speed connection to get it all to display a commenting system with no comments whatsoever! Zero! Null! Nada!

For comparison, my website is ready after 300ms under the same network conditions using my current solution. The full functionality requires to download only 1kb of JavaScript. It’s worth mentioning that this data is coming from an article that contains over 100 comments. The Lighthouse score isn’t that bad neither.

Lighthouse score of my individual page with more than 100 comments

Freedom #

Because I built it, I can do whatever the heck I want with it. I have full control over the functionality and the visual aspect of it. I can even do shit like this!

A funny snippet of code

My new commenting system tech stack #

There are a few HTML lines on the front end, around 100 lines of custom-written CSS and about 1kb of vanilla JavaScript. On the backend side of things, I use AWS Lambda to put something on and read from DynamoDB. I also build a little moderation tool that allows me to discard or approve new comment by clicking a link in an email. To send notification emails, I use Amazon Simple Email Service.

My custom commenting system built with AWS - diagram

My custom commenting system built with AWS - the notification email

My custom commenting system built with AWS - diagram

Pro tip! You can send a POST request on link click by adding a ping attribute to it. I learned that from Sven, who tweeted about it a few days ago. Excellent, isn’t it?

A space-separated list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs. Typically for tracking.

Feedback please #

I’m planning to open-source it and provide a detailed tutorial on how you can implement a commenting system like this on your own website. Before I am going to do so, I want this thing to be properly tested. I highly encourage you to try it out and leave me a comment below. As always, I am open to your feedback. For now, stay curious, build cool things and share with others 👋

Comments

  • C
    Christian Oliff

    This looks great! Would be very interested to read an in depth tutorial- and open sourcing the code would be awesome.

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      Thanks for feedback Christian. Really appreciate it!

      Yeah, first think I want this thing to be battle tested. Then I will wrap the whole think in concise, configurable repo and publish a detailed tutorial about the process of setting it up. Stay tuned Christian 👊

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • L
    Leon

    I would definetely read & use it :) Thought about doing the same using Svelte, FastAPI & MongoDB in a hosted VM in China (cause disqus does not work here).

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      Stay tuned. I will definitely write a follow-up very soon 👍

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • M
    Mac Ziehlke

    This looks cool. Some time ago (years now), I tried to build SAAS solution that would be competition to Disqus, but as almost all of my projects I never released it. I would advise to take a look into something that will pick up spam auto-magically. Also, just my curiosity, why Netlify build hook, not Github Actions, or something else?

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      …but as almost all of my projects I never released it

      Shame. Maybe I would end up using your product instead of crafting my own one.

      Thanks for the great suggestions about some spam filtering. I did a fair bit of research on this one, and I have some ideas.

      Yeah. GitHub action is another way of doing the same thing. I care about the fresh content hosted to the end-user — any method that gets me to that point is a great solution. Netlify build hook was dead easy to set up.

      Thanks for the fantastic feedback Maciej!

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • L
    Liam

    I'd definitely be interested in deep diving into how this works. Nice work!

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
  • J
    Jeff

    Looks awesome! How are comments ordered?

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      Thanks Jeff. Comments are ordered chronologically on each level. By levels, I mean the difference between top level comments (like your comment for example) and child level comments (like this one). Hopefully it makes sense.

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • p
    pengolod

    this is pretty cool :D

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
  • R
    Real Barack Obama

    That's noice! I like the simplicity and the innovation. Do you think about a login layer using cognito or something like that?

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      Hi. I am glad that you like it. I deliberately made a decision not to require any login/registration to participate in the conversation. I simply don't want to deal with users and I wanted to reduce a potential privacy/security pitfalls. Simplicity is the key.

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
      • E
        Eric

        YES! That's exactly what I'm looking since quite a while! Somehow there seems to be no privacy-friendly login-free commenting system out there. Commento is nice, but needs to be paid too much (imho) for low traffic sites. I'd love my readers to be able to simply drop me a line and deciding to post it under their anonymous nick name, no login.

        Please publish your tutorial!

        👆 you can use Markdown here

        Your comment is awaiting moderation. Thanks!
        • Pawel Grzybek
          Pawel Grzybek

          I am working on it, stay tuned 😎

          👆 you can use Markdown here

          Your comment is awaiting moderation. Thanks!
  • S
    Słonecznik 🌻

    Well done ♥️

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
  • C
    Chris Collins

    This is fantastic Pawel. Well done 😊

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
  • S
    Sap

    Awesome, like I said to you last time "in those days it is hard to find someone who doing good thinks just because they are good", stay with that. Sooner or later I will learn enough to be programmer. Is special letters works ? Ą ę ć ß æ ī . Pozdro

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      Of course it works. As long as the current font supports these (I use system fonts on my blog) characters it should just work with no issues. Thanks a ton fir the kind word!

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • F
    Feliks Dudek

    Awesome job, Pawel! I really feel like there is a big business opportunity for blog commenting, especially with growing popularity in static sites which lack native Wordpress comments. I was about to jump the gun on Hyvor talk which looks the most promising, but a solution like yours has its advantages, so I'll consider things for a bit longer.

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      Hopefully I will make your life a little bit easier when I show you how simple it is to add a commenting system to your JAM stack website. Stay tuned as the tutorial is coming soon.

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • J
    Juan Villacorta

    Wow, this is perfect for JAMStack

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!
    • Pawel Grzybek
      Pawel Grzybek

      Yes it is! Stay tuned as the details tutorial is coming soon :)

      👆 you can use Markdown here

      Your comment is awaiting moderation. Thanks!
  • S
    Steven

    Also very interested, it would allow me to discover these AWS services. The only "black dot" I see is a kind of "identity theft", anyone can take someone's nickname and behind it we would not be able to know if we are talking to the same "human". And good, markdown support :D

    👆 you can use Markdown here

    Your comment is awaiting moderation. Thanks!

What'ya think?

👆 you can use Markdown here

Your comment is awaiting moderation. Thanks!