Git Product home page Git Product logo

arkismicroservices's Introduction

Cloud-native ARKIS Prototype

The ARKIS microservices prototype is a cloud-native document management system created using a cloud-native architecture within the Service Prototyping Lab at Zurich University of Applied Sciences. The design criteria the software adheres to are elastic scalability and resilience achieved through managed composite microservices and isolation flexibility achieved through runtime-configurable multi-tenancy models. The implementation consists of Docker containers running atop Kubernetes. (Our blog posts also inform about how to achieve similar setups with docker-compose and Vamp.)

image

Microservice architecture

  • Each microservice is instantiated using a docker container image; 8 in total plus one for the database (external image).
  • You can see the code inside the folder 'containers'.
  • All the images are in the public docker hub repository: chumbo

Frontend microservices

Login

  • port_login: 32000
  • UI for the login web page.
  • You can try to login or create a new user.

Users

  • port_users: 32001
  • UI for the users web page.
  • You can manage all the documents of these user.(create, delete, search, ...)

Admin

  • port_login: 32002
  • Admin UI web page.
  • You can see users, delete users, add new generic documents, migrate between the different multi-tenant options.

Backend microservices

Note: All backends are implemented with Python using the Bottle web service framework.

Documents

  • port_documents: 31999
  • CRUD of documents

Search

  • port_search: 30004
  • Full text search in the documents of one user.

Migrate

  • port_migrate: 30003
  • Move the documents of one user to a different multi-tenant option.

Data

  • port_data: 30002
  • For add generic documents to one user.

Users

  • port_users: 30001
  • CRUD users.

Database micro-services

  • Persistent deployment for documents and users.
  • The container image is the official mongo image.
  • The database for users is running in the port 30009.

Documents

Different multitenant option. All these options are working in these version.

  • A: Shared DBMS, Shared database, shared schema, shared table/collection - port: 30005
  • B: Shared DBMS, Shared database, shared schema, one table/collection per tenant - port: 30006
  • C: Shared DBMS, Shared database, one schema per tenant. (Not make sense with mongo) - port: 30007
  • D: Shared DBMS, one database per tenant - port: 30008
  • E: One DBMS per tenant - port: 30010 + tenant_id

API REST

Useful endpoints for the API REST:

Users

  • GET: host:port_user/users/(id)
  • GET: host:port_user/users/
  • POST: host:port_user/users
  • PUT: host:port_user/users
  • DELETE: host:port_user/users/(id)
  • GET: host:port_user/validate/(user)/(password)

Documents

  • GET: host:port_documents/documents/(user)/(option)/last
  • GET: host:port_documents/documents/(user)/(option)/lim/(lim)
  • GET: host:port_documents/documents/(user)/(option)/(other_id)
  • POST: host:port_documents/documents/(user)/(option)
  • PUT: host:port_documents/documents/(user)/(option)/(other_id)
  • DELETE: host:port_documents/documents/(user)/(option)/(other_id)

Search

  • GET: host:port_search/documents/search/(user)/(option)/(pattern)

Data

  • GET: host:port_data/data/(user)/(option)/(limit)

Migrate

  • GET: host:port_migrate/migrate/(user)/(option)

We have created an OpenAPI specification file of this API. In this file we cover in detail the two main microservices: Documents and Users. You can use the swagger.json file to see all the information easly using the friendly swagger ui.

You can deploy the Kong files in this repository to have Kong in Kubernetes (no persistance). Or use the official one if your kubernetes cluster is in Google cloud. Now for add each microservices to Kong you must use the names: documents, search, data, migrate and users. To use the API with Kong you must use the Kong endpoint with the same path that are described before it and with the name of the microservices as a header parameter. Example: curl -X GET "http:// + endpoint Kong +/documents/2/A/last" -H "accept: application/json" -H "Host: documents"

Tutorial

Create

  1. Clone this repository.
  2. Install kubectl

Google persistance

  1. Create a kubernetes cluster in google cloud.
  2. Create the next persistent disks in the same zone that you have your cluster:
  • a: mongodb-disk-a
  • b: mongodb-disk-b
  • c: mongodb-disk-c
  • d: mongodb-disk-d
  • e: mongodb-disk-(number of tenant) where number of tenant belong to {0,1, ... ,9}
  • users: disk-mongo-shared-users
  1. Run the script: create.sh
  2. If you want create more tenants with the multitenant option E:
    • Create the persistent: disk mongodb-disk-(number of tenant)
    • Create the microservice:
      • cd KubernetesBlueprints/DatabaseMicroServices/googlecloudpersistance/OPTIONE
      • change the nodePort to 30010 + number of tenant
      • run: kubectl create -f .

No persistance

  1. Run the script: create-nopersistance-a.sh

Use

Until here, you have running ARKIS 3.0. Now, you can add users and documents using the Admin UI or the API REST. The first user that you create will be the admin. The rest are users of the app. From the Admin view you can add documents to the users. From the User view you can manage your documents.

Delete

No persistance

    • If you want keep your cluster: Run the script: delete-nopersistance-a.sh
    • If you don't want keep your cluster: Just delete your cluster

Google persistance

    • If you want keep your cluster: Run the script: delete.sh
    • If you don't want keep your cluster: Just delete your cluster
  1. Delete all the persistent disk.

Next steps

  1. Create automatically the persistent disk for the multi-tenancy option: E.
  2. Create blueprints for docker-swarm.
  3. Extend swagger specification for the rest of microservices.

arkismicroservices's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.