Use Cases Analysis

How to convert valid use cases into ready-to-implement Cloud Functions.

Purpose

The purpose of this document is to create a simple and scalable process that allows us to convert valid uses cases into ready-to-implement Cloud Functions.

Scope

This procedure applies to any team of architects that obtains a use case and wants to implement it using reusable Cloud Functions.

Procedures

1. Use Case Analysis

When we find a Use Case, the first question we ask ourselves is Is this a valid use case? To answer this question we go through analysis and discussions based on the following basic parameters:

  • Jobs: describe the things your customer are trying to get done in their work. Tasks that the customer is trying to perform and complete, the problems they are trying to solve, or the needs they are trying to satisfy.

  • Pain Points: describe anything that annoys your customer before, during, and after trying to get a job done. Also, describe risks, that is, potential bad outcomes, related to doing a bad job or doing nothing.

  • Expected Gains: describe the outcome and benefits your customers want. Some gains are required, expected or, desired by customers, and some would surprise them.

If our use case responds to at least one of the parameters above means that we have a valid use case, then we can move forward to the next step.

2. Architecture Design

As we begin the process of designing possible solutions to this problem, it's important to answer these three questions:

  • Is it possible to solve the problems using cloud functions?

  • Can we make the functions available in a reusable way?

  • How?

The outcome of this step is a set of function definitions, which translates into a list of function.config.json files. Depending on the function trigger, you may need to define the usage API for your functions.

On the function.config.json, you need to define the following values in each function:

  • Name

  • Description

  • Trigger

  • Environment Variables

Here is an example of a function.config.json file where the use case is to send a welcome email when a new customer signs up in the application:

{
    "name": "sendSignUpWelcomeEmail",
    "description": "Send a welcome email when users sign up throughout a SendGrid template.",
    "tags": [ "sendGrid", "sign up", "email"],
    "trigger": {
        "provider": "auth",
        "event": "user.create"
    },
    "env": [
        {
            "name": "SENDGRID_API_KEY",
            "description": "The API key to authenticate access to SendGrid services.",
            "required": true
        },
        {
            "name": "SENDGRID_SENDER_EMAIL",
            "description": "Email corresponding to SendGrid sender correctly verified.",
            "required": true
        },
        {
            "name": "SENDGRID_TEMPLATE_ID",
            "description": "The ID of SendGrid dynamic template that will be used to generate the welcome email.",
            "required": true
        }
    ]
}

3. Implementation

The implementation process begins with the requirements defined in the "Architecture Design" step. To be more specific in the implementation process, Go to the Next Page(WIP).

Last updated