Live data from Hacker News

Simplify Service Dependencies with Nodes

blog.twitter.com

31–40 of 60 posts

Re: Simplify Service Dependencies with Nodes

#31

Maybe I'm missing something, how is this better than simple promises in JS? This seem easy to reason about: serviceA { Promise.All(b,c).then(...) } serviceB { (d).then(...) } serviceC { Promise.All(d,e).then(...) }

The "simple promises" from JS are (somewhat crippled) copies of Futures from other languages. In Scala the results of those futures can be produced at the same time, even if they are purely computational as Scala and most other languages are both asynchronous AND concurrent.

Re: Simplify Service Dependencies with Nodes

#32

Maybe I'm missing something, how is this better than simple promises in JS? This seem easy to reason about: serviceA { Promise.All(b,c).then(...) } serviceB { (d).then(...) } serviceC { Promise.All(d,e).then(...) }

The library they referenced (Finagle) does pretty much just that. A few things that leapt out at me:

- It's hard to figure out what the dependency graph looks like just from promises

- That pattern is verbose and results in gross types when you do it in Java

- With this library, you can easily profile parts of the algorithm to see what's going slow, what's taking a bunch of memory, etc.

Re: Simplify Service Dependencies with Nodes

#33

Maybe I'm missing something, how is this better than simple promises in JS? This seem easy to reason about: serviceA { Promise.All(b,c).then(...) } serviceB { (d).then(...) } serviceC { Promise.All(d,e).then(...) }

I think Fnangle is an abstraction over futures. The selling point I found when looking at Tokio (rust equivalent, references Fnangle) was that you write a driver for each backend and then have generic services to implement things such as timeouts. So you can reuse the timeout code for your network queries and your db queries.

Re: Simplify Service Dependencies with Nodes

#34

Maybe I'm missing something, how is this better than simple promises in JS? This seem easy to reason about: serviceA { Promise.All(b,c).then(...) } serviceB { (d).then(...) } serviceC { Promise.All(d,e).then(...) }

Thank you! This is just Promise.all but for microservices. Every time a large company discovers that its messy infrastructure can be cleaned up a bit by reimplementing a simple programming concept, it's suddenly not just newsworthy but framework worthy

Re: Simplify Service Dependencies with Nodes

#35

Maybe I'm missing something, how is this better than simple promises in JS? This seem easy to reason about: serviceA { Promise.All(b,c).then(...) } serviceB { (d).then(...) } serviceC { Promise.All(d,e).then(...) }

The "simple promises" from JS are (somewhat crippled) copies of Futures from other languages. In Scala the results of those futures can be produced at the same time, even if they are purely computational as Scala and most other languages are both asynchronous AND concurrent.

JS is async and concurrent. I resent it's limitations as much as any self respecting developer, but workers are finally in.

Re: Simplify Service Dependencies with Nodes

#36

Maybe I'm missing something, how is this better than simple promises in JS? This seem easy to reason about: serviceA { Promise.All(b,c).then(...) } serviceB { (d).then(...) } serviceC { Promise.All(d,e).then(...) }

The "simple promises" from JS are (somewhat crippled) copies of Futures from other languages. In Scala the results of those futures can be produced at the same time, even if they are purely computational as Scala and most other languages are both asynchronous AND concurrent.

[deleted]

Re: Simplify Service Dependencies with Nodes

#37

Maybe I'm missing something, how is this better than simple promises in JS? This seem easy to reason about: serviceA { Promise.All(b,c).then(...) } serviceB { (d).then(...) } serviceC { Promise.All(d,e).then(...) }

Looks just like that. As dstaten said, "just Promise.all but for microservices". I've been contributing to an open-source project called snappi.io - a microservice blueprint that includes very comparable dynamic RPC functionality. Combining RPC with standardized service contracts allows us to create and inject stubs for distributed systems as they get shipped out to solve the problems described in the article. Happy to see companies like Twitter following a similar path, and we're hoping to bring those patterns to more applications powered by a wide variety of tech-stacks.

Re: Simplify Service Dependencies with Nodes

#38
post #4
post #2

So, between the lines - Twitter looks ahead to move to Java 8 and finally ditch Scala?

Hum .. don't think so. Not quite yet at least. Underneath this, there is Finagle on top of which most services at Twitter is built on. It offers a java API, but remains a Scala library. And there's still a lot of existing code inside to twitter to ditch Scala right away. Java 8 is awesome, but Java is still not an FP language.

IMHO the problem with Java 8 is not the language but framework support. Except SparkJava, most other frameworks use Java 8 as a "upgraded java compiler". Tge canonical way to write code is still Java 6.

I think the best way to upgrade your java codebase is Kotlin. On the server side, Kotlin +vertx is extremely compelling.. on the Android side, Kotlin pretty much kills it.

Re: Simplify Service Dependencies with Nodes

#39

Maybe I'm missing something, how is this better than simple promises in JS? This seem easy to reason about: serviceA { Promise.All(b,c).then(...) } serviceB { (d).then(...) } serviceC { Promise.All(d,e).then(...) }

Looks just like that. As dstaten said, "just Promise.all but for microservices". I've been contributing to an open-source project called snappi.io - a microservice blueprint that includes very comparable dynamic RPC functionality. Combining RPC with standardized service contracts allows us to create and inject stubs for distributed systems as they get shipped out to solve the problems described in the article. Happy…

that's very interesting. Have you looked at linkerd.io (used in production at large kubernetes deployments)

Re: Simplify Service Dependencies with Nodes

#40
post #4

Earlier quoted context omitted.

Hum .. don't think so. Not quite yet at least. Underneath this, there is Finagle on top of which most services at Twitter is built on. It offers a java API, but remains a Scala library. And there's still a lot of existing code inside to twitter to ditch Scala right away. Java 8 is awesome, but Java is still not an FP language.

IMHO the problem with Java 8 is not the language but framework support. Except SparkJava, most other frameworks use Java 8 as a "upgraded java compiler". Tge canonical way to write code is still Java 6. I think the best way to upgrade your java codebase is Kotlin. On the server side, Kotlin +vertx is extremely compelling.. on the Android side, Kotlin pretty much kills it.

I agree. This is exactly the move I've made when I was CTO of a company needing a move to the JVM from .NET. Given the options of Java, Scala - I moved to picking Kotlin. In many ways, Kotlin for me is Scala without the different ways to hang yourself. I wish it was given more credit that it gets right now outside of the Android circles.
Post reply on HN