Skip to content

Algorithms for testing Spring and Serverless architectures

Notifications You must be signed in to change notification settings

Morat96/syncServices

Repository files navigation

Microservices and Serverless Benchmarking

Serverless platforms

  • Apache OpenWhisk;
  • Azure Functions;
  • IBM Cloud Functions;
  • AWS Lambda;
  • Google Cloud Functions.

For each platform, the folders present are the following:

  • Java
    • RSA Decryption;
    • CRUD benchmark;
    • Vehicle Routing Problem.
  • NodeJS
    • RSA Decryption;
    • CRUD benchmark;
    • Vehicle Routing Problem.

Algorithms

RSA Decryption

This algorithm finds from a public key composed by the couple (n, e), the private key d. This problem in NP-Hard.

CouchDB CRUD benchmark

This benchmark performs the four crud operations against a couchdb NoSql database, in order to measure the speed of architectures when are involved in actions that deal with read/write/delete/update operations.

  • Create: This algorithm performs a POST request to a couchdb database. The algorithm creates a set of documents composed of random words and to then are applied a set of sort operations. Then the documents are added to the database with a bulk operation (from couchdb).
  • Update: This algorithm performs a PUT request to a couchdb database. The algorithm gets all the documents of the database, chooses a set of documents randomly and re-creates the documents with the same operations as in Create. Then the documents are updated with a bulk operation (from couchdb).
  • Remove: This algorithm performs a DELETE request to a couchdb database. The algorithm gets all the documents of the database, chooses a set of documents randomly and deletes the documents, with a bulk operation (from couchdb).
  • Query: This algorithm performs a GET request to a couchdb database. The algorithm performs a Query to the database, in particular the query searches for a word in the "content" key of each document present in the database and returns all the documents that have the word in their content. The algorithm shows the result to the user in a Json format.

Vehicle Routing Problem

This algorithm solves a VRP instance with a set of heuristic algorithms. The first solution is build the Nearest Neighbour algorithm for VRP. Then the 2-optimality is reached with a 2-OPT algorithm which examines all pairs of arcs of the solution choosing the optimal way to reorder the archs. After that a Metaheuristic algorithm can refine the solution with the Variable Neighbour Search algorithm. The VNS implements two algorithms: The first swaps randomply three or more cities of the entire solution by respecting the demand constraints; The second one performs a shuffle of each tour (of each vehicle) swapping three or more edges of the tour randomly. With the combination of the two algorithms (chosen with equal probability) one can escape from the local optima and finds a better solution (with a lower cost).