1
4 Comments

Hey IH, Recently I started playing around with Netlify and Netlify Functions for making websites.

Hey IH,

Recently I started playing around with Netlify and Netlify Functions for making websites.

I love Netlify's easy deploy functionality and running Node.js functions in the cloud (ie "serverless")

Has anyone connected to a database with Netlify/Serverless?

I ran into trouble with FaunaDB which they had tutorials on. I'm thinking bout trying Firebase or MongoDB connections next

#tech-questions

, Founder of Icon for Employbl
Employbl
on May 9, 2019
  1. 2

    I use Netlify exclusively for hosting and deploying static sites (front-ends) from github, because it's simply the best, easiest, and most user-friendly by far!

    However, if you like to get into serverless, why not start with AWS, and more specifically trying out AWS AppSync (they have hosting which is similar to netlify offering). That way you could make a GraphQL API that would leverage lambdas and connect to DynamoDB or other databases.

    Alternatively, if you're not into GraphQL deploy a lambda from AWS console and add an API Gateway trigger so it would have a POST request associated with it

    Firebase is a great option which is simpler yet but doesn't have as many services.

    Start by figuring out which database you need, relational or non-relational, and go from there.

  2. 2

    Firebase might be more suitable as there is nothing to set up and maintain, while their free tier is rather generous. The only palpable downside is that Firebase is Google owned and Google is notorious for abrupt product shut downs or significant change policies with a brief notice or no notice at all.

    1. 2

      I like Firebase too (aside from the downsides noted above). Would love to see how Netlify goes for you though. I've heard great things. Have you played around with authenticating users/API requests with Netlify? That's something I always struggle with, so if they have an easy way to do it, I'm all in.

    2. 1

      Going to play more with faunadb: https://employbl.com/blog/connect-fauna-database-gatsby-serverless

      I ran into a bug (outlined in the blog post) but a member of their team reached out. Am gunna fix that shit (with their help) next week! #faunadb