Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 14, 2021 05:54 pm GMT

Serverless Storage for Your Node.js Functions with OpenFaaS and Astra DB

Learn more about Functions-as-service (FaaS), Astra DB, and Node.js on the upcoming Livestream with Alex Ellis, OpenFaaS, and Stefano Lottini from DataStax!

When: Thursday, September 16th at 4:00 p.m. BST//11:00 a.m. EDT/8:00 a.m. PDT.

To get the most out of the live event, be sure to check out the OpenFaaS blog first!

Did you ever wish you had persistent storage for your serverless functions? Storage that was as easy as an idiomatic API call in your favorite language? What if you could even handle JSON data with no upfront schema definition? Functions as a service (FaaS) are excellent containers for business logic. With functions, you can:

  • Run backend code without managing any infrastructure whatsoever.
  • Run short-lived code that starts FaaST, runs and shuts down when complete or unused.
  • Run your code in a specific framework or library of your choice.
  • Trigger a function based on events that are defined by the FaaS provider.

Thats great, but what happens to the application state? Yes, you could run an in-process cache, session store, or use the modest filesystem allocated to the function. But these workarounds will be as short-lived as the function, so its not what most people consider persistent storage.

Using APIs and or Drivers, you can get data out from your functions and into a database, but not many databases employ data API gateways or offer easy ways to surface a fluent data access layer in APIs like REST or GraphQL. Perhaps you have JSON data and you simply want a document-style NoSQL option that skips defining the schema upfront just JSON and go.

So lets assume getting to your database is easy with APIs, drivers, and schemaless JSON for a moment. Why then, would a serverless, autoscaling database be the preferred choice for persistent storage for your serverless, autoscaling functions? First off, its important to understand that serverless and FaaS are not quite the same thing. The key thing that makes FaaS and Serverless DBaaS so great together is autoscaling.

If you've invested in DBaaS and FaaS, you're probably not interested in managing infrastructure. Running serverless functions that have the potential to autoscale up rapidly is dangerous if connected directly to a back-end database that cannot auto-scale.

Scaling up the application dynamically could put an unpredictable and increasing load on a data service or database that doesnt use a similar (auto) scaling mechanism. The industry spent years trying to solve this problem in the application server era with connection pools and database connection conservation techniques. Most of those techniques are antithetical to FaaST-startup-and-terminate style serverless functions because theres no connection to preserve!

Pairing an autoscaling application tier to a data tier that doesnt autoscale drags down a system that could have otherwise been fully automated. Manually running a terraform script, or worse, waiting for an operations ticket to be created and serviced for scaling the database instance up or down would kill 50% of the automation value between application (function) and database. No Bueno.

So how can we wire together an autoscaling DBaaS like DataStax Astra DB, with serverless functions without having to write a ton of REST services to expose the database functions you need? Let us show you how!

Join Alex Ellis and Stefano Lottini from DataStax on a Livestream this Thursday, September 16th at 4:00 p.m. BST//11:00 a.m. EDT/8:00 a.m. PDT to learn how to pair FaaS with a serverless, autoscaling DBaaS for end-to-end automated scaling. Alex and Stefano will be ready to take your questions live and cover a number of different use cases!

Subscribe & remind

Join the Livestream: https://www.youtube.com/watch?v=uJyufpJ3204

Learn More:

Follow the DataStax Tech Blog for more developer stories. Check out our YouTube channel for tutorials and here for DataStax Developers on Twitter for the latest news about our developer community.


Original Link: https://dev.to/datastax/serverless-storage-for-your-node-js-functions-with-astra-db-1igc

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To