News for hackers. Stuff that matters.
Re:Give Me Back My Monolith by alexk on Wednesday March 13, 2019 @04:59PM (#19383705)
I think that microservices are just a deployment model of the service boundary and there should not be really a distinction between whether something is deployed as a microservice or a monolith, because application should support both for the scenarios when it makes sense.

Consider the following API:

  UsersService:
   CreateUser
   GetUser

  AppCatalog:
   GetApp
   CreateApp
What if AppCatalog and UsersService implement both local version of the interface and GRPC one? Then the distinction whether it's a microservice vs a monolith goes away, it becomes a matter of whether they are deployed in a single linux process or across boundaries of processes/servers.

I have implemented this technique in teleport:

https://github.com/gravitational/teleport/tree/master/lib/se...

Integration test suite is run against RPC version and local version at the same time to make sure the contract remains the same:

https://github.com/gravitational/teleport/blob/master/lib/se...

A single teleport binary can be deployed on one server with all microservices, or multiple cluster scenarios.

where the binary is simply instantiated with different roles:

  auth_service:
    enabled: yes
  node_service:
    enabled: no

Is Teleport a monolith? Yes! Is it a micro-service app? Yes! I'm so happy that we don't have to think about this split any more.
Re:Give Me Back My Monolith by qaq on Wednesday March 13, 2019 @05:05PM (#19383773)
The question is transaction boundaries try unrolling a change that had to touch state of several services and one of the requests failed
Re:Give Me Back My Monolith by alexk on Wednesday March 13, 2019 @05:11PM (#19383838)
Right, because we write against DynamoDB/Etcd transactions were a non-option anyways, and we only have CompareAndSwap as a locking primitive

https://github.com/gravitational/teleport/blob/master/lib/ba...

In addition to that Golang's context

https://golang.org/pkg/context/

is used to broadcast the failure of a distributed operation and release associated resources with it

Re:Give Me Back My Monolith by Thaxll on Wednesday March 13, 2019 @05:22PM (#19383966)
Re:Give Me Back My Monolith by alexk on Wednesday March 13, 2019 @05:43PM (#19384189)
It's probably closer to multi-writes though, than transactions in a classic sense, but good improvement nevertheless.
Re:Give Me Back My Monolith by Thaxll on Thursday March 14, 2019 @01:32PM (#19391452)
Re:Give Me Back My Monolith by AmrMostafa on Thursday March 14, 2019 @05:16AM (#19387590)
I don’t think it is ok to try and make service boundaries transparent and swappable. A service speaking to another service has to know the cost and overhead of the call it is making as otherwise it can’t provide an efficient interface