Live data from Hacker News

Build a hit counter for Gatsby with React, AWS Lambda, and FaunaDB

joshwcomeau.com

1–10 of 52 posts

Re: Build a hit counter for Gatsby with React, AWS Lambda, and FaunaDB

#4
post #2

I may be missing something here, but... all that for a hit counter? Even using React for the front-end seems overkill for a little widget.

these days the hard part isn't the view counter logic, it's managing the 395,000 dependencies in your project

Re: Build a hit counter for Gatsby with React, AWS Lambda, and FaunaDB

#5
post #2

I may be missing something here, but... all that for a hit counter? Even using React for the front-end seems overkill for a little widget.

i totally agree. plus the fact that he's using a DAS for storing the data. if there is one thing i refuse to do is not be in charge of my database or using something proprietary.

Re: Build a hit counter for Gatsby with React, AWS Lambda, and FaunaDB

#7
post #2

I may be missing something here, but... all that for a hit counter? Even using React for the front-end seems overkill for a little widget.

The hit counter is merely an example! I see this blog post as an intro to how-to-connect React up to a hosted database over this fancy serverless paradigm thingy.

Re: Build a hit counter for Gatsby with React, AWS Lambda, and FaunaDB

#9
> q.Update(document.ref, { data: { hits: document.data.hits + 1, ...

Does FaunaDB have an "atomic increment" a la Firestore? Knowing nothing about FaunaDB, I suspect this code in the blog post has the potential to "lose" hits that come in at roughly the same time...

Re: Build a hit counter for Gatsby with React, AWS Lambda, and FaunaDB

#10
post #2

I may be missing something here, but... all that for a hit counter? Even using React for the front-end seems overkill for a little widget.

these days the hard part isn't the view counter logic, it's managing the 395,000 dependencies in your project

I used to be “dependency-first” for library code, but I’ve noticed lately that my first question has been “why wouldn’t it be a good idea to build in house?”
Post reply on HN