Cinema 3 - (Extremely Simplified) Example of Microservices in Python

Overview

microservices-master.zip

Cinema 3 is an example project which demonstrates the use of microservices for a fictional movie theater. The Cinema 3 backend is powered by 4 microservices, all of which happen to be written in Python using Flask.

  • Movie Service: Provides information like movie ratings, title, etc.
  • Show Times Service: Provides show times information.
  • Booking Service: Provides booking information.
  • Users Service: Provides movie suggestions for users by communicating with other services.

Requirements

  • Python 2.7
  • Works on Linux, Windows, Mac OSX and (quite possibly) BSD.

Install

The quick way is use the provided make file.

 $ make install 

Starting and Stopping Services

To launch the services:

 $ make launch 

To stop the services:

 $ make shutdown 

APIs and Documentation

Movie Service (port 5001)

This service is used to get information about a movie. It provides the movie title, rating on a 1-10 scale, director and other information.

To lookup all movies in the database, hit: http://127.0.0.1:5001/movies

GET /movies
Returns a list of all movies.

{
    "267eedb8-0f5d-42d5-8f43-72426b9fb3e6": {
        "director": "Ryan Coogler", 
        "id": "267eedb8-0f5d-42d5-8f43-72426b9fb3e6", 
        "rating": 8.8, 
        "title": "Creed"
}, 
...... output truncated ...... 

To lookup a movie by its id:

GET /movies/7daf7208-be4d-4944-a3ae-c1c2f516f3e6
Returns the specified movie.

{
    "director": "Paul McGuigan", 
    "id": "7daf7208-be4d-4944-a3ae-c1c2f516f3e6", 
    "rating": 6.4, 
    "title": "Victor Frankenstein", 
    "uri": "/movies/7daf7208-be4d-4944-a3ae-c1c2f516f3e6"
}

Showtimes Service (port 5002)

This service is used get a list of movies playing on a certain date.

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

To lookup all showtimes, hit: http://127.0.0.1:5002/showtimes

GET /showtimes
Returns a list of all showtimes by date.

{
"20151130": [
    "720d006c-3a57-4b6a-b18f-9b713b073f3c", 
    "a8034f44-aee4-44cf-b32c-74cf452aaaae", 
    "39ab85e5-5e8e-4dc5-afea-65dc368bd7ab"
], 
...... output truncated ...... 

To get movies playing on a certain date:

GET /showtimes/20151201
Returns all movies playing on the date.

[
    "267eedb8-0f5d-42d5-8f43-72426b9fb3e6", 
    "7daf7208-be4d-4944-a3ae-c1c2f516f3e6", 
    "39ab85e5-5e8e-4dc5-afea-65dc368bd7ab", 
    "a8034f44-aee4-44cf-b32c-74cf452aaaae"
]

Booking Service (port 5003)

Used to lookup booking information for users.

To get all bookings by all users in the system, hit: http://127.0.0.1:5003/bookings

GET /bookings
Returns a list of booking information for all bookings in the database.

{
    "chris_rivers": {
        "20151201": [
            "267eedb8-0f5d-42d5-8f43-72426b9fb3e6"
        ]
    }, 
    ...... output truncated ...... 

To lookup booking information for a user:

GET /bookings/dwight_schrute

    {
        "20151201": [
            "7daf7208-be4d-4944-a3ae-c1c2f516f3e6", 
            "267eedb8-0f5d-42d5-8f43-72426b9fb3e6"
        ], 
        "20151205": [
            "a8034f44-aee4-44cf-b32c-74cf452aaaae", 
            "276c79ec-a26a-40a6-b3d3-fb242a5947b6"
        ]
    }

User Service (port 5000)

This service returns information about the users of Cinema 3 and also provides movie suggestions to the users. It communicates with other services to retrieve booking or movie information.

To get a list of all the users in the system, hit: http://127.0.0.1:5000/users

GET /users
Returns a list of all users in the database.

{
    "chris_rivers": {
        "id": "chris_rivers", 
        "last_active": 1360031010, 
        "name": "Chris Rivers"
    }, 
    ...... output truncated ...... 

To lookup information about a user:

GET /users/michael_scott
{
    "id": "michael_scott", 
    "last_active": 1360031625, 
    "name": "Michael Scott"
}

To get suggested movies for a user:

GET /users/michael_scott/suggested

 

[출처] https://github.com/umermansoor/microservices#cinema-3---extremely-simplified-example-of-microservices-in-python

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
37 Awesome TensorFlow : 멋진 텐서플로우 오픈소스 프로젝트 졸리운_곰 2018.10.23 586
36 텐서플로우-#1 자료형의 이해 file 졸리운_곰 2018.08.15 619
35 How to build a simple neural network in 9 lines of Python code file 졸리운_곰 2018.08.14 587
34 Mining English and Korean text with Python file 졸리운_곰 2018.03.26 9303
33 [TENSORFLOW] tensorboard 사용하기 file 졸리운_곰 2018.03.24 1661
32 텐서보드 사용법 file 졸리운_곰 2018.03.24 591
31 Networks in Python and SciKit Learn 0.18 file 졸리운_곰 2018.03.22 697
30 한글 NLP with Python file 졸리운_곰 2018.03.04 908
29 python 텐서플로우 설치 후 테스트 코드 file 졸리운_곰 2018.03.04 1648
28 파이썬으로 3줄 요약기를 만들어보자. file 졸리운_곰 2018.03.04 2655
27 Convolutional Neural Networks in Python with Keras file 졸리운_곰 2018.02.18 724
26 합성곱 신경망(CNN) 딥러닝을 이용한 한국어 문장 분류 file 졸리운_곰 2018.02.18 589
25 A Flask API for serving scikit-learn models file 졸리운_곰 2017.08.22 380
24 Installing scikit-learn¶ 사이킷 런 설치 졸리운_곰 2017.07.02 1265
23 scikit-learn 설치 방법 및 간단한 테스트 졸리운_곰 2017.07.02 1143
22 tensorflow windows 10 gpu 적용 설치 졸리운_곰 2017.07.01 1315
21 scikit-learn 파이썬과 기계학습 - 1 file 가을의곰 2017.06.18 1597
20 Scikit-Learn 패키지의 소개¶ 가을의곰 2017.06.18 743
19 Python NLP - NLTK and scikit-learn file 가을의곰 2017.06.18 510
18 윈도우 GPU tensorflow 설치 및 그래픽카드별 성능 비교 file 졸리운_곰 2017.06.10 564
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED