Poptato – A Micro-Service Solution By Idan Asraf (313292781) & Natanel Orenstein (313247512)

Introduction Poptato is a dedicated, micro-service based, solution for movie theaters to manage and expose their information about movies, shows and orders. The project was developed for educational, and is not generally intended for commercial use. It is release as open-source under the MIT license, in a dedicated GitHub organization. We’ve built the project using NodeJs, leveraging existing high-quality open-source libraries. The different components in the project use RethinkDB for persistency, and have Docker support for running & testing locally.

The Micro-Services Discovery Service This micro-service acts as an abstraction layer, simplifying access to the functional components (micro-services) in the system; by hiding the micro-service architecture implementation. It acts as a proxy, forwarding requests coming through it to the correct micro-service to handle the request. This is how the proxy is mapping the requests: HTTP Method Any (GET, POST, …) Any (GET, POST, …) Any (GET, POST, …) Any (GET, POST, …) Any (GET, POST, …) Any (GET, POST, …) Any (GET, POST, …) Any (GET, POST, …)

Discovery Request Path /movies/* /celebs/* /oscars/* /cinemas/* /theaters/* /shows/* /orders/* /customers/*

Target Micro-Service Movie Service Movie Service Movie Service Show Service Show Service Show Service Order Service Order Service



Web-Client Service This micro-service acts as a simple static-files server, serving the web-client’s assets to a browser user.

Movie Service

Manages information about movies. In addition to basic information about the movie itself, the system also manages complex associations of the movie. This includes cast, director & Oscar awards management. All entities & relation are exposed via secured REST API endpoints, allowing creation and querying of information.

Show Service Manages information about cinemas, theaters & shows. All entities & relation are exposed via secured REST API endpoints, allowing creation and querying of information.

Order Service Manages information about customers, orders and payment methods (credit cards). All entities & relation are exposed via secured REST API endpoints, allowing creation and querying of information.

Micro-Service Relations The micro-services in our application interact with each other, in order to accomplish complex tasks involving functionality from multiple micro-services. This is a part of the micro-service architecture methodology. The micro-services communicate with the outside world, and with each other using HTTP requests, using the common method of REST API. Service-to-service communication is secured via HTTPS and support BASIC authentication.



Technology Stack Services (Server-Side)

For the server-side we’ve used the following technologies: ü NodeJs open-source, cross-platform JavaScript run-time environment. ü ExpressJs Fast, un-opinionated, minimalist web framework for Node.js.

Database All our micro-services are using instances of RethinkDB which is a NoSQL, open-source database for real-time applications.

Web Client Our web client is written in HTML5, JavaScript ES2017 & CSS3. We’re using Polymer which is a JavaScript library that helps you create custom reusable HTML elements, and use them to build performant, maintainable apps.



Micro-Service Interaction Examples Get Show Information When an API consumer sends a request to get show information, the Show Service requests the movie’s information from Movie Service, assembles the response and send it to the consumer.







Get Order Receipt When an API client requests a receipt for an order, the Order Service requests the following information from other services: 1. Requests the show information from the Show Service, based on the id in order. 2. Requests the movie information from the Movie Service based on the id in show. Then, order service assembles the receipt object before sending the response to the client.





Testing To test and verify our solution we’ve used the common “testing pyramid” approach. Each component (micro-service) in our solution have both unit-tests & API-tests. In addition, we have an integration test suite, which validate the integration between the different components and verify the main flows in the solution. Non-functional testing, focusing on performance testing, is being measured and handled by Docker.

Tool Stack

The testing technology stack we’ve chose consists of the following tools: ü ü ü ü ü ü

Mohca as test runner for all functional tests. Chai as assertion library, using BDD testing style. Sinon as mock library. Supertest for HTTP mocking & REST API testing. Docker for running component locally & non-functional testing. Docker-Compose for running components together & integration testing.



Difficulties During the development of our micro-service based solution we’ve encountered two major issues, both related to running locally and testing the solution.

Running Full Solution Locally Our solution consists of multiple stand-alone components, each being an HTTP server. Running the services together and making them play nicely while keeping the environment clean has proved to be difficult. Our solution to this problem is using Docker for wrapping each service in a container for running the application locally on an isolated environment (container). We also used DockerCompose to create container networks for combining each service with its own database container, and creating a network of all the services.

Synchronizing Database(s) Population Populating the database(s) with mock data is being done asynchrony, and we have no meaning of synchronizing between them before running integration tests. Our solution to this problem, after few hours of research and trying was to omit a signal from each process and awaiting all signals to arrive before executing the integration tests. This was not easy has each service is running in its own Linux container.

Poptato – A Micro-Service Solution - GitHub

associations of the movie. This includes cast, director & Oscar awards management. All entities & relation are exposed via ... Our web client is written in HTML5, JavaScript ES2017 & CSS3. We're using Polymer which is a JavaScript library that helps you create custom reusable HTML elements, and use them to build ...

475KB Sizes 2 Downloads 39 Views

Recommend Documents

Solution Requirements and Guidelines - GitHub
Jan 14, 2014 - will be specific to J2EE web application architectures, these requirements ... of other common web technologies a foundation for developing an Anti-‐CSRF solution with .... http://keyczar.googlecode.com/files/keyczar05b.pdf.

Dell | Cloudera Solution User's Guide - GitHub
Oct 3, 2013 - Figure 5: License Key Confirmation Screen . .... Figure 18: Cluster Services Initialization Screen . .... Local Area Network on Motherboard. NIC.

Solution for the Search Results Relevance Challenge - GitHub
Jul 17, 2015 - They call such method as semi-supervised learning. ... 2. calculate the pdf/cdf of each median relevance level, 1 is about 7.6%, 1 + 2 is ..... Systems: Proceedings of the 2011 Conference (NIPS '11), pages 2546–2554, 2011.

A Win-Win Solution - EdChoice
The Friedman Foundation for Educational Choice is a 501(c)(3) nonprofit and nonpartisan organization, solely dedicated to advancing Milton and Rose Friedman's vision of school choice for all children. First established as the Milton and Rose D. Fried

LSM: The Local Sky Model A Solution: The LSM LSM ... - GitHub
o contribute changes/scripts, an account on lofar9 is required. ... ou can create yourself a Bugzilla account on the front ... average developer's mental stack. USE.

A. Channel Setting - GitHub
B. User ID setting. D. Sleeping Time Setting. E. Mode Setting. Memory Mode. Normal Mode. 8. 9. CHSET. 6. Data Count. 60 Seconds. 5 Minutes. Data Delete.

Gabriel A. Devenyi - GitHub
Nov 14, 2016 - Responsible for the crafting of communications strategies, through website, social media email and traditional media and the development and ...

Annex A: Maps - GitHub
focused spatial data infrastructure for South Sudan. Overview ... independence analysis of the same resources, policies and features. ... Africover. LULC PDF.

exhibit a - GitHub
Aug 18, 2017 - evidenced by a June 28, 2017 “tweet” from the @Sci_Hub Twitter account stating: “American Chemical Society files suit against Sci-Hub .

A BigJob - GitHub
But, the width of DNA is about 2 nm so its volume is less than the nucleus. The trick it to wind ...... github.io/BigJob/sphinxdoc/install/redis.html. [4] SAGA-BigJob.

D A. R - GitHub
policy, and “big data” issues in the geosciences including the design and construction ... novel applications of machine learning and data science to the analysis .... Aerosol-Cloud-Climate Interactions. Seattle, WA. 2017. |. PDF. Rothenberg,D.

A primer about licenses - GitHub
Intellectual property: why do we care (as researchers)?. Things created in research. ▷ Scientific writings (articles, blog posts, . . . ) ▷ Data. ▷ Software. ▷ Other ...

Alarm clock - model A - GitHub
ALARM ON-OFF. 5.797. 3.495. USB HOST. ETHERNET ... Alarm Clock. TITLE. Final assembly (Model A) ..... ARM System-On-Module. 1. 3. DM3AT-SF-PEJM5.

A Headline Another Headline - GitHub
email : [email protected] phone : 940-203-4093. A Headline ... Designed and implemented a set of tools for automation of pr. Another Headline.

A Network of Rails - GitHub
network of open source projects centered around Ruby on Rails. This dataset provides ... reasons, were often hosted on large source code hosting sites, the most dominant of ... GitHub also added two major new “social” features: the ability to sta

A CTF Hackers Toolbox - GitHub
Page 10 ... http://www.javadecompilers.com/. Android apps/Dalvik bytecode apktool, smali/baksmali, jadx. Xposed .NET bytecode. ILSpy, Jetbrains dotPeek ...