Drupal 

& Micro service

Andy Truong @GO1

Twitter: thehongtt

 

04 March 2016

I am

  • Drupal developer since 2006
  • The starter of Drupal Vietnam
  • Drupal Saigon meetup organiser
  • PHP Saigon meetup organiser
  • V3K
  • GO1 consultant

Drupal

is amazing

Solid CMS foundation

  1. User, Role, Node, Revision, Taxonomy, Comment.

  2. Entity, Fields

  3. Module, Theme

  4. Module repository: views, panels, search api, voting api, eck, webform, entity form.

  5. Distribution repository: OpenAtrium, OpenPublish, Commerce Kickstart, OpenScholar

Great community

  1. Good documentation: drupal.org/documentation, api.drupal.org

  2. Ative support: IRC, #stackXChange, Facebook groups

  3. Local meetup

Amazing contributors

  1. Big companies: Acquia, Lullabot, FFW, PreviousNext

  2. Talent people: Dries B., Steven acko Witten, Karoly chx Negyesi, webchick, Aaron Winborn, node, Crell, …

Success stories

  1. https://www.drupal.org/case-studies

  2. http://buytaert.net/tag/drupal-sites

But

Drupal is hard

Hard to learn

…many concepts

Hard to develop

the code is too complex

Hard to debug

  1. large code base
  2. Complex sub system (views, ctools, …)
  3. Low quality modules

Hard to build product

  1. Hire good developer
  2. Scale
  3. Deploy
  4. Many modules for a single Drupal site

Micro service

What is micro service

  • Maybe small
  • Simple
  • HTTP

Benefits

  • Easy to develop
  • Easy to maintenance
  • Easy to scale
  • Easy to outsource
  • Easy to try new technology

martinfowler.com

Examples

  • Amazon web services: S3, SQS, …
  • Cloudinary
  • Algolia
  • Simple demo
    • https://go1-marketplace.firebaseapp.com/

But

Dependency

  1. A service that depends on other service
  2. A service may down, other should work
  3. queue/worker

Separate the data

  1. The object should be stored in single tables
  2. Don't use JOIN queries.
  3. Demo: http://staging.mygo1.com/webapp/#/app/reports

Monitor

Just use pingdom, cloudwatch, …

Internal network

Just use Consul

Authentication

  1. Problem: The services does not understand who is requesting
  2. Solution: JWT
  3. JWT:
    1. HEADER.PAYLOAD.SIGNATURE
    2. HEADER: Information about the string
    3. PAYLOAD: Main data
    4. SIGNATURE: Make sure the JWT is not changed

Conclusion

Study the architect, don't study the tool/framework

Thank you!

Drupal & microservice

By Andy Truong

Drupal & microservice

  • 1,700