Go micro with microservices

Go micro with microservices

34be88398f623c109b61d23e8215bd23?s=128

Mariusz Gil

August 20, 2016
Tweet

Transcript

  1. 2.
  2. 3.
  3. 5.
  4. 6.
  5. 7.
  6. 8.
  7. 10.
  8. 11.
  9. 13.
  10. 16.
  11. 22.
  12. 25.
  13. 26.

    <div> <p>Widget 1</p> </div> <div> <p>Widget Two</p> <div cx-url='{{server:local}}/application/component1'></div> </div>

    <body> <div cx-url='{{server:local}}/application/component2'></div> </body> <body> <div cx-url='{{server:local}}/application/component2'> <div> <p>Widget Two</p> <div cx-url='{{server:local}}/application/component1'> <div> <p>Widget 1</p> </div> </div> </div> </div> </body>
  14. 27.

    <div cx-url='{{server:local}}/application/widget' cx-cache-ttl='10s' cx-no-cache="\{{cookie:userId}}==={{authorId}}" cx-cache-key='widget:user:{{cookie:userId}}' cx-timeout='1s' cx-statsd-key=„widget_user"> This content won't

    be cached if the user is the author of the widget </div> <div cx-url='{{server:local}}/application/widget' cx-cache-ttl='10s' cx-cache-key='widget:user:{{cookie:userId}}' cx-timeout='1s' cx-statsd-key="widget_user"> This content will be replaced on the way through </div>
  15. 32.
  16. 34.

    TOOLING Docker Spinnaker CONFIGURATION Archaius Habitat DISCOVERY Zookeeper Consul ROUTING

    Compose
 Linkerd OBSERVABILITY Zipkin Histrix DATASTORES SQL
 NoSQL OPERATIONS Mesos
 Kubernetes DEVELOPMENT Docker Hub
 Artifactory POLICY Security and arch compliance
  17. 38.
  18. 43.

    $factory = new Ejsmont\CircuitBreaker\Factory(); $circuitBreaker = $factory->getSingleApcInstance(30, 300); $userProfile =

    null; 
 if( $circuitBreaker->isAvailable("UserProfileService") ){ try{ $userProfile = $userProfileService->loadProfileOrWhatever(); $circuitBreaker->reportSuccess("UserProfileService"); }catch( UserProfileServiceConnectionException $e ){ // network failed - report it as failure $circuitBreaker->reportFailure("UserProfileService"); }catch( Exception $e ){ // something went wrong but it is not service's fault, // dont report as failure } } if( $userProfile === null ){ // for example, show 'System maintenance, you cant login now.' message // but still let people buy as logged out customers. }
  19. 45.
  20. 46.