Upgrade to Pro — share decks privately, control downloads, hide ads and more …

eureka Go ~Our Designing of a Microservices Architecture~

eureka Go ~Our Designing of a Microservices Architecture~

- Microservices at eureka
-- Design a Microservices Architecture
-- The Microservices Architecture of pairs
- Project Structure
-- Build up the pairs Project
-- Development Operations
- Web Application Framework

Shintaro Kaneko

December 12, 2015
Tweet

More Decks by Shintaro Kaneko

Other Decks in Programming

Transcript

  1. eureka Go
    @kaneshin

    View Slide

  2. Shintaro Kaneko (kaneshin)
    - Photographer and Engineering Manager at eureka, Inc.
    kaneshin
    kaneshinth
    shintaro.kaneko
    Mathematics: Optimization Problems
    2010
    2012
    2011
    Quality Assurance
    Engineer at eureka
    Real Estate in Vancouver, Canada

    View Slide

  3. Agenda
    ‣ Microservices at eureka
    ‣ Design a Microservices Architecture
    ‣ The Microservices Architecture of pairs
    ‣ Project Structure
    ‣ Build up the pairs Project
    ‣ Development Operations
    ‣ Web Application Framework

    View Slide

  4. Microservices at eureka

    View Slide

  5. BEFORE THAT :)

    View Slide

  6. The Monolithic Architecture of
    pairs (PHP)

    View Slide

  7. View Slide

  8. ʊਓਓਓਓਓਓʊ
    ʼɹMonolithɹʻ
    ʉ̮̮̮̮̮̮ʉ

    View Slide

  9. Monolith?

    View Slide

  10. Our Designing of
    a Microservices Architecture

    View Slide

  11. Our Designing of a Microservices Architecture
    ‣ Service-Oriented Architecture
    ‣ Separated Data Store from a Specific Layer
    ‣ Keep Code at a Similar Level
    ‣ Do a Separate Build for Each Microservice

    View Slide

  12. Our Designing of a Microservices Architecture
    ‣ Service-Oriented Architecture
    ‣ Separated Data Store from a Specific Layer
    ‣ Keep Code at a Similar Level
    ‣ Do a Separate Build for Each Microservice

    View Slide

  13. Service-Oriented Architecture
    ‣ Not Component-Oriented Architecture
    ‣ Loosely Coupled Elements
    ‣ Updatable one service doesn’t require changing any other
    services.

    View Slide

  14. Our Designing of a Microservices Architecture
    ‣ Service-Oriented Architecture
    ‣ Separated Data Store from a Specific Layer
    ‣ Keep Code at a Similar Level
    ‣ Do a Separate Build for Each Microservice

    View Slide

  15. Separated Data Store from a Specific Layer

    View Slide

  16. Separated Data Store from a Specific Layer

    View Slide

  17. Our Designing of a Microservices Architecture
    ‣ Service-Oriented Architecture
    ‣ Separated Data Store from a Specific Layer
    ‣ Keep Code at a Similar Level
    ‣ Do a Separate Build for Each Microservice

    View Slide

  18. Keep Code at a Similar Level
    ‣ Actually, we don’t but we can do it.
    ‣ Immutable Infrastructure (Infrastructure As Code)
    ‣ Tesing: Continuous Integration

    View Slide

  19. Our Designing of a Microservices Architecture
    ‣ Service-Oriented Architecture
    ‣ Separated Data Store from a Specific Layer
    ‣ Keep Code at a Similar Level
    ‣ Do a Separate Build for Each Microservice

    View Slide

  20. The Microservices Architecture of
    pairs (Up to now)

    View Slide

  21. View Slide

  22. The Microservices Architecture of
    pairs (From now on)

    View Slide

  23. ɾ
    ɾ
    ɾ

    View Slide

  24. Batch
    Batch
    Batch
    ɾ
    ɾ
    ɾ

    View Slide

  25. Batch
    Batch
    Batch
    ɾ
    ɾ
    ɾ
    Service-Oriented
    Architecture
    Separated
    Data Store
    Separate Build

    View Slide

  26. Each Microservices Responsible For
    ‣ Payment Service
    ‣ Already Released
    ‣ Responsible for Payment at eureka
    ‣ Search Service
    ‣ Write Code with net/http
    ‣ Elasticsearch is

    View Slide

  27. Each Microservices Responsible For
    ‣ Surveillance Service
    ‣ Word Filtering
    ‣ Monitoring User (like Spam)
    ‣ Analysis Service
    ‣ for eureka
    ‣ Algorithm, Mathematical Analysis, Machine Learning, …

    View Slide

  28. Each Microservices Responsible For
    ‣ And More
    ‣ Auth
    ‣ Like
    ‣ Message
    ‣ …

    View Slide

  29. Project Structure

    View Slide

  30. How to Build up the Project?

    View Slide

  31. Server-Side Specifications
    ‣ Internationalization (i18n)
    ‣ Web Application Framework
    ‣ Revel, Goji
    ‣ Testing Tools
    ‣ onsi/ginkgo, stretchr/testify/assert
    ‣ DB Management Tools
    ‣ xorm (ORM), goose (Migration)
    I’m not going to talk about tools today.

    View Slide

  32. Repository Structure

    View Slide

  33. Early Period

    View Slide

  34. pairs-admin.git
    pairs-web.git

    View Slide

  35. Simple!

    View Slide

  36. Middle Period

    View Slide

  37. pairs-admin.git
    pairs-web.git
    pairs-core.git

    View Slide

  38. Then

    View Slide

  39. payement.git pairs-core.git
    pairs-search.git pairs-batch.git
    pairs-admin.git
    pairs-web.git

    View Slide

  40. Pretty Good?

    View Slide

  41. View Slide

  42. View Slide

  43. Complex and Risky

    View Slide

  44. Integrated Repository

    View Slide

  45. payement.git
    pairs.git

    View Slide

  46. Integrated Repository
    ‣ Maintenance of Git Respository
    ‣ Didn’t Purge All Commits (logs)
    ‣ Throw away useless files (garbage)
    ‣ Problems of Continuous Integration
    ‣ All components to run tests

    View Slide

  47. Development Operations

    View Slide

  48. View Slide

  49. push
    webhook
    webhook

    View Slide

  50. push
    webhook
    - Verify Code (Static Analysis)
    - Documentation
    - JSON Hyper Schema (HTML)
    - Database Schema (HTML)
    webhook

    View Slide

  51. push
    webhook
    - Verify Code (Static Analysis)
    - Documentation
    - JSON Hyper Schema (HTML)
    - Database Schema (HTML)
    push
    webhook

    View Slide

  52. Web Application Framework

    View Slide

  53. Web Application Framework at eureka
    ‣ Revel (pairs)
    ‣ goji (payment, reception)
    ‣ gin (xxxxxxx)

    View Slide

  54. I prefer to use net/http

    View Slide

  55. So

    View Slide

  56. Good bey Revel from pairs!
    (forever)

    View Slide

  57. Why?

    View Slide


  58. View Slide

  59. Agenda
    ‣ Microservices at eureka
    ‣ Design a Microservices Architecture
    ‣ The Microservices Architecture of pairs
    ‣ Project Structure
    ‣ Build up the pairs Project
    ‣ Development Operations
    ‣ Web Application Framework
    Talk to me after that! :)

    View Slide

  60. Copyright © 2009-2015 eureka, Inc. All rights reserved.
    Thank you

    View Slide