Designing an mobile system with Gprc + Elixir

Incorporating gRPC + Elixir in Mobile Application

We want to be able to use the gRPC framework to make a remote procedure call. Basically, it is a way that allows our mobile clients to directly make requests from the mobile app server without being able to receive all the network details locally.

There are lots and lots of use-cases for incorporating gRPC and Elixir, see Use Cases for some examples about how it could be used. 

Use Cases

#

User(s)

Use-case

1

Mobile Server

Inter-microservice communication

2

Client Request

Aggregate data from multiple microservices 

3

Mobile Server

Creating users

4

Client Request

Fetching users

System Design Decisions for consideration

  1. What exactly do we expect the mobile app to fetch from the server endpoints?

  2. Which microservices have we decided at this point in time to make provision for in our mobile app infrastructure?

  3. What problem does the decision to use Elixir as a programming language solve?

  4. Are merchant and client authentication handled by other specific tools on the backend?


DevOps Pipeline

CI


  1. We need to ensure that another stable branch exists by creating a new branch called release

    • We will create release off of develop. All our acceptance and regression testing will be done on the release branch

  2. On a local version of the mobile app

    • We need to avoid potential merge conflicts in the localization files, by pulling in the dev branch into release using a local GUI. If there are any conflicts in the localization files, they’ll be cleared out by the new files later. We should be keeping an eye out for any other merge conflicts.   

  3. When we are ready to release to our users, we merge release into master. Master is our most stable branch that mimics the app on the app store.

  4. Merging into master automatically triggers a build on codemagic.io. An iOs and Android app are built by codemagic.

  5. We might need to write a script that updates master from the new release to automate the process.

  6. And then run smoke tests on the release build. The current configuration is build

    • Debug apk

    • Release apk

    • iOs app

CD
  1. On code magic, we need to add tests for the critical functionality

  1. Writing specific build instructions in a YAML file will give us more opportunities to tinker with our build configuration.

  2. After the build is successful, we can manually deploy to the Play Store or App Store

We are using code magic here because of our tech stack.

  • User and Merchant Logins connect to an IGW. 

  • A VPC will be created that hosts the EC2 instance

  • A NAT Gateway will limit inbound traffic

  • An SG will control ingress and egress traffic from the EC2 instance

  • A health check will be added to the instance which will have a rule to Autoscale the instance if there are issues

  • The EC2 instance will be connected to an Endpoint which can be connected to 3rd party APIs like stripe\

Comments

Popular posts from this blog

Coffee Culture in Ghana

The Nostalgic Resurgence of Shounen Anime

Writing Automated Tests with Kotlin