microservices

DB consistency with microservices

陌路散爱 提交于 2019-11-28 18:46:11
问题 What is the best way to achieve DB consistency in microservice-based systems? At the GOTO in Berlin, Martin Fowler was talking about microservices and one "rule" he mentioned was to keep "per-service" databases, which means that services cannot directly connect to a DB "owned" by another service. This is super-nice and elegant but in practice it becomes a bit tricky. Suppose that you have a few services: a frontend an order-management service a loyalty-program service Now, a customer make a

Should I use forever/pm2 within a (Docker) container?

牧云@^-^@ 提交于 2019-11-28 16:28:04
问题 I am refactoring a couple of node.js services. All of them used to start with forever on virtual servers, if the process crashed they just relaunch. Now, moving to containerised and state-less application structures, I think the process should exit and the container should be restarted on a failure. Is that correct? Are there benefits or disadvantages? 回答1: My take is do not use an in-container process supervisor (forever, pm2) and instead use docker restart policy via the --restart=always

Single Sign-On in Microservice Architecture

一曲冷凌霜 提交于 2019-11-28 15:28:32
I'm trying to design a green-field project that will have several services (serving data) and web-applications (serving HTML). I've read about microservices and they look like good fit. The problem I still have is how to implement SSO. I want the user to authenticate once and have access to all the different services and applications. I can think of several approaches: Add Identity service and application. Any service that has protected resources will talk to the Identity service to make sure the credentials it has are valid. If they are not it will redirect the user for authentication. Use a

Angular and Micro-Frontends

社会主义新天地 提交于 2019-11-28 14:38:55
问题 I am doing some research on how to split a huge single-page-monolith into a micro-frontend architecture. The idea: the page consists of several components which would be running autonomously each component is managed by one dev-team each team can change, update and deploy their components without breaking components of other teams each team chooses its own toolstack The reason To efficiently develop large applications you need to have many people working on it. However the number of

Is the HTTP method PURGE idempotent in Varnish?

谁说我不能喝 提交于 2019-11-28 14:17:01
Is the HTTP verb PURGE idempotent? If I send the same PURGE request twice will I receive 200 the second time? I have a microservice that invalidates a Varnish cache before publishing a message into a rabbit queue. In case of purge failure our need is to just log and continue the execution. The queue consumer has to get the latest status of the resource from the Varnish cache. Will a new purge request (before actually requesting the resource from varnish) from the second microservice return success in case the first purge from the first microservice succeeded? PURGE is not a standard HTTP

Microservice on GAE+ Mix of Standard and Flexible GAE Services

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 10:14:04
问题 We have two separate projects as follows GAE Standard on JAVA runtime, let us say- APP1 GAE Flexible on Python runtime, let us say- APP2 We want to move both the projects in one micro-services application project with two services, say APP1service (default), and APP2service. Wanted to check if it is possible to host standard and flexible GAE services sharing one application identity in microservices setup? Quick answer is highly appreciated. ps. Google documentation does not answer this

Eureka and Kubernetes

☆樱花仙子☆ 提交于 2019-11-28 03:35:23
I am putting together a proof of concept to help identify gotchas using Spring Boot/Netflix OSS and Kubernetes together. This is also to proove out related technologies such as Prometheus and Graphana. I have a Eureka service setup which is starting with no trouble within my Kubernetes clouster. This is named discovery and has been given the name "discovery-1551420162-iyz2c" when added to K8 using kubectl run discovery --image=xyz/discovery-microservice --replicas=1 --port=8761 For my config server, I am trying to use Eureka based on a logical URL so in my bootstrap.yml I have server: port:

Using Zuul as an authentication gateway

故事扮演 提交于 2019-11-28 03:24:10
Background I want to implement the design presented in this article . It can be summarised by the diagram below: The client first authenticate with the IDP (OpenID Connect/OAuth2) The IDP returns an access token (opaque token with no user info) The client makes a call through the API gateway use the access token in the Authorization header The API gateway makes a request to the IDP with the Access Token The IDP verifies that the Access Token is valid and returns user information in JSON format The API Gateway store the user information in a JWT and sign it with a private key. The JWT is then

Eureka service discovery without Spring-boot

安稳与你 提交于 2019-11-27 21:34:15
I have written a spring boot micro-service and a REST client. The client is a part of another module and make RESTful calls to the micro-service. The micro-service registers with the Eureka registry and I want my client (Which is not a spring boot project) to use the Eureka to query and get the service endpoints. My problem is since the client is not a Spring-Boot applications I can not use the annotations like @SpringBootApplication , @EnableDiscoveryClient and the DiscoveryClient is not get auto wired to the application. Is there anyway to manually auto-wire the DiscoveryClient bean to the

How to deploy SpringBoot Maven application with Jenkins ?

ぐ巨炮叔叔 提交于 2019-11-27 20:42:53
问题 I have a Spring Boot application which runs on embedded Tomcat servlet container mvn spring-boot:run . And I don’t want to deploy the project as separate war to standalone Tomcat. Whenever I push code to BitBucket/Github, a hook runs and triggers Jenkins job (runs on Amazon EC2) to deploy the application. The Jenkins job has a post build action: mvn spring-boot:run , the problem is that the job hangs when post build action finished. There should be another way to do this. Any help would be