Adopting serverless architectures for SPA 

Single-page applications (SPAs) provide one of the most suitable scenarios for adopting a serverless architecture approach. After all, they do not involve much-coded business logic, and they mainly serve and consume content provided by services deployed somewhere else.

For example, suppose that we need to build an application to send the World Cup results to users. In this example, we will need to address the following requirements:

  • Authentication
  • Data storage
  • Notification mechanisms

Using a serverless architecture approach, these requirements can be addressed by the following service providers: 

  • Authentication: Google OAuth
  • Data storage: Google Firebase
  • Notification mechanisms
    • SMS, using Twilio
    • Email, using SparkPost

The following diagram illustrates how to use the preceding services (Google OAuth, Firebase, Twilo, and SparkPost) as parts of an application:

Integrating different third-party applications

The preceding diagram shows some of the most well-known service providers, but there are a lot of other options available on the internet.

One of the benefits of the preceding services is that all of them provide an SDK, or library, that can be used directly from an SPA, including common JavaScript libraries, such as Angular.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.171.212