Connect is a Python Flask project within the cloud-native ecosystem

Overview

Connect

Project 2 from Cloud-Native Nanodegree

Extracting the monolith

The first step is to understand how the current system is architected and identify clear context boundaries. There are three diagrams for that:

What is clear from the beginning is that Connection has two dependencies: Location and Person, while Location has one dependency: Person. It's possible to implement one service per entity. The frontend calls two resources: Connection Data Resource and Persons Resource. Since these two entities will probably be separated in different services, we might need a proxy available for the frontend that will redirect the requests to the microservices.

A good candidate for the first refactoring would be Connection entity, since it only imports and isn't imported by anything. But there is no simple way for it to import Location and Person, so let's think of something else.

I see Person as the most isolated entity. Location needs a Person ID in order to be created, but this has no relation with Person model and it is received directly from the request. Therefore, we can start with a Person microservice and setup a proxy. The Person microservice will be an internal service that requires fast and reliable responses, so we can use gRPC to communicate. But we can use REST to start.

Step 1: Person microservice structure

  • person_service
    • person
      • model
      • schema
      • service
      • controller
    • routes
    • config

Methods: - Create - Retrive - Retrieve All

Step 2: Create a proxy to redirect Person requests to Person microservice and the rest to the Monolith

This proxy will have the same address as the frontend is expecting and will communicate with Person service and the monolith via RESTful APIs. The monolith will have its address changed to have a smooth migration.

After that, it's clear that Location is coupled with Connection entity; we'll need to refactor and move Location logic in ConnectionService to Location methods before moving it to its own service.

Step 3: Refactor and extract Location

  • location_service
    • location
      • model
      • schema
      • service
      • controller
    • routes
    • config

Location is also an internal service and we can use gRPC for communication, but we can start with REST.

After that, we can finally get rid of the monolith and work on extracting Connection microservice. This service will require a RESTful API due to the communication with the frontend, but it'll also implement gRPC in the future to communicate with internal services.

Step 4: Extract Connection

  • connection_service
    • connection
      • model
      • schema
      • service
      • controller
    • routes
    • config

From that we have our microservices implemented and we can implement gRPC between them.

Step 5: Implement gRPC communication in the internal services

After that, we need to evaluate the performance and possible caveats in the system.

Owner
Lauren Ferreira
Creating things I'm proud of.
Lauren Ferreira
Heroku Flask Setup

Heroku Flask Setup

Abhimanyu Haralukallu 0 Dec 07, 2021
A Python chat app built with Flask that runs in the browser.

A Python chat app built with Flask that runs in the browser. Designed for local area networks that are not connected to the Internet.

Leonard Kleber 1 Dec 23, 2021
Easy file uploads for Flask.

Library that works with Flask & SqlAlchemy to store files on your server & in your database Read the docs: Documentation Installation Please install t

Joe Gasewicz 145 Jan 06, 2023
É uma API feita em Python e Flask que pesquisa informações em uma tabela .xlsx e retorna o resultado.

API de rastreamento de pacotes É uma API feita em Python e Flask que pesquisa informações de rastreamento de pacotes em uma tabela .xlsx e retorna o r

Marcos Beraldo Barros 4 Jun 27, 2021
This is a small notes web app, with python and flask microframework. Using sqlite3

Python Notes App. This is a small web application maked with flask-python for add notes easily and quickly. Dependencies. You can create a virtual env

Eduard 1 Dec 26, 2021
MongoEngine flask extension with WTF model forms support

Flask-MongoEngine Info: MongoEngine for Flask web applications. Repository: https://github.com/MongoEngine/flask-mongoengine About Flask-MongoEngine i

MongoEngine 815 Jan 03, 2023
Flask webassets integration.

Integrates the webassets library with Flask, adding support for merging, minifying and compiling CSS and Javascript files. Documentation: https://flas

Michael Elsdörfer 433 Dec 29, 2022
Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure.

Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure. All the required libraries are already installed easily to use in any big project.

Ajay kumar sharma 5 Jun 14, 2022
A Flask web application that manages student entries in a SQL database

Student Database App This is a Flask web application that manages student entries in a SQL database. Users can upload a CSV into the SQL database, mak

rebecca 1 Oct 20, 2021
Pagination support for flask

flask-paginate Pagination support for flask framework (study from will_paginate). It supports several css frameworks. It requires Python2.6+ as string

Lix Xu 264 Nov 07, 2022
Browsable web APIs for Flask.

Flask API Browsable web APIs for Flask. Status: This project is in maintenance mode. The original author (Tom Christie) has shifted his focus to API S

Flask API 1.3k Jan 05, 2023
Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.

Flask-Rebar Flask-Rebar combines flask, marshmallow, and swagger for robust REST services. Features Request and Response Validation - Flask-Rebar reli

PlanGrid 223 Dec 19, 2022
Are-You-OK is a Flask-based, responsive Web App to monitor whether the Internet Service you care about is still working.

Are-You-OK Are-You-OK is a Flask-based, responsive Web App to monitor whether the Internet Service you care about is still working. Demo-Preview Get S

Tim Qiu 1 Oct 28, 2021
Control YouTube, streaming sites, media players on your computer using your phone as a remote.

Media Control Control Youtube, streaming sites, media players on your computer using your phone as a remote. Installation pip install -r requirements.

Shreyas Daniel 10 Dec 08, 2022
This is a repository for a playlist of videos where I teach building RESTful API with Flask and Flask extensions.

Build And Deploy A REST API with Flask This is code for a series of videos in which we look at the various concepts involved when building a REST API

Ssali Jonathan 10 Nov 24, 2022
Open-source Flask Sample built on top of flask-dance library

Open-source Flask Sample built on top of flask-dance library. The project implements the social login for Github and Twitter - Originally coded by TestDriven.IO.

App Generator 4 Jul 26, 2022
A gRpc server like Flask (像Flask一样的gRpc服务)

Mask A gRpc server just like Flask. Install Mask support pypi packages, you can simply install by: pip install mask Document Mask manual could be fou

吴东 16 Jun 14, 2022
Telegram bot + Flask API ( Make Introduction pages )

Introduction-Page-Maker Setup the api Upload the flask api on your host Setup requirements Make pages file on your host and upload the css and js and

Plugin 9 Feb 11, 2022
A Flask app template with integrated SQLAlchemy, authentication, and Bootstrap frontend

Flask-Bootstrap Flask-Bootstrap is an Flask app template for users to clone and customize as desired, as opposed to a Flask extension that you can ins

Eric S. Bullington 204 Dec 26, 2022
Flask RESTful Web services using API to communicate between client and server.

Welcome! Open up two terminals, one for client and for server each Terminal 1 Terminal 2 Now navigate to the CW2_code directory in both like so $ cd C

Sehra Elahi 1 Nov 23, 2021