Posts

Legacy Displacement

  "When faced with the need to replace existing software systems, organizations often fall into a cycle of half-completed technology replacements. Our experiences have taught us a series of patterns that allow us to break this cycle, relying on: a deliberate recognition of the desired outcomes of displacing the legacy software, breaking this displacement in parts, incrementally delivering these parts, and changing the culture of the organization to recognize that change is the unvarying reality...." https://martinfowler.com/articles/patterns-legacy-displacement/

HTTP/2 - HTTP/1

HTTP/1.1 assumes that a TCP connection should be kept open unless directly told to close. HTTP2 reduces latency by using multiplexing, compression and prioritization. An application level API would still create messages in the conventional HTTP formats, but the underlying layer converts the payload into binary (binary framing). HTTP/2 establishes a single connection object between the two machines. Within this connection there are multiple streams of data. Each stream consists of multiple messages in the familiar request/response format. Finally, each of these messages split into smaller units called frames. Multiplexing: Several requests and responses can run in parallel using a single TCP connection without blocking each other. This reduces processor and memory resources and the SSL handshakes. Stream prioritization feature allows developers to prioritize the requests by assigning a weight between 1 and 256 to each stream. The higher number indicates higher priority.  server ca

Some thoughts on Conway's law

Human beings are complex social animals. Rome was not built in a day. Address the issues that can be addressed first. Create independent subsystems to reduce the communication cost. Read more:  https://medium.com/@Alibaba_Cloud/conways-law-a-theoretical-basis-for-the-microservice-architecture-c666f7fcc66a

Java 9 Jigsaw - How to create modules

Image

Java 10 - type inference with var

Go to: https://blog.codefx.org/java/java-10-var-type-inference/

Java - Replace traditional for loops with IntStreams

Go to: https://www.deadcoderising.com/2015-05-19-java-8-replace-traditional-for-loops-with-intstreams/

Finagle

Build request: RequestBuilder requestBuilder = new RequestBuilder()   // custom class                 .withMethod(method)                 .withHeader(xxx, "xxx")                 .withPath(endpoint)                 .withParams(request.getPathParams())                 .withQueryParams(request.getQueryParams()); Service<Request, Response> restService = restServiceProvider.getService(serviceLabel); Finagle Call:         final Future<O> responseFuture = filter.apply(request, restService);         final O result         try {             result = Await.result(responseFuture, Duration.fromMilliseconds(config.getTotalRequestTimeout()));         } catch (Exception e) { ... }          return result;