]> Matthias Wimmer (溫雅石)

Recent Content

Reactive Programming with RxJava

posted on

RxJava is an implementation of “Reactive Extensions” (Rx) in Java. But what is this? Originally Rx are an implementation of Microsoft to address the increasing complexity of software. It is a model to build large scale asynchronous service architectures.

Another company that has to be mentioned is Netflix: they implemented the Rx in Java which resulted in RxJava.

On the programming side Rx looks very similar to how streams (java.util.stream.Stream) work. The main difference in my opinion is that streams are pull and lazy. They produce only as much data as someone is reading from them. RxJava on the other side is more push style. The source of data is pushing events through a pipe of operators similar to what you know from streams (filter(), map(), and so on) to the sink. And as I know from this book, Java streams are the wrong tool to parallelize anything that is not CPU bound–like network requests. There reason for this is, that (parallel) streams are executed on a thread pool that is shared with several other features of Java. This thread pools is limited to have only that many workers as the system has CPU cores. Therefore this pool gets exhausted very soon, when threads in it get blocked by I/O operations. Any thread waiting for an I/O operation effectively results in a processor core not used by your program.

RxJava on the other hand is not limited to a fixed thread pool. Any source (Observable) and sink (Subscriber) of data can be bound declaratively to user defined Schedulers. As well as Rx favours a model in which I/O operations are done asynchronously and non-blocking. Therefore resulting in a need for much fewer threads. In a traditional model of using one thread per network connection, threads become very soon the first thing that limits scalability.

What is really great about this book

The best part of this book for me were the reflections on Relational Database Access in chapter 5. While as a developer you might be tempted to convert everything to the reactive model, this part of the book shows where it doesn't make sense to do so.

By converting the access to your relational database to an asynchronous model you won't gain anything. Whatever you are doing on the client side, let's say for example your PostgreSQL will run all of your concurrent requests in different processes. This results in a noticeable limit on the number of parallel queries you're able to run. You cannot lift this limit by becoming asynchronous on the client side.

Links to the book

ZooKeeper, Distributed Process Coordination

posted on

ZooKeeper is a component that facilitates building distributed applications. It is:

The data managed by ZooKeeper is presented in a file system like manner with directories and files whose names get separated by slashes (/). The difference to a file system is, that you can store information in the directories as well. Or seen differently: directories are files at the same time. Based on this simple abstraction, users of ZooKeeper can implement things like leader election in a cluster of software instances.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Microservice Architecture, anligning principles, practices, and culture

posted on

To stay on the right track with microservices, I wanted to revisit the philosophy and organizational recomendations on how to do them right. After reading Building Microservices in april this year, I got Microservice Architecture, aligning principles, practices, and culture by Irakli Nadareishvili et al.; O'Reilly Media, Inc., 2016.

The book can be read on one week-end as the content is very well condensed to 118 pages.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Developing Web Components, UI from JQuery to Polymer

posted on

It's hard to find sources how to do front-end micro-services in a single page application (SPA). Having a single front-end that faces the user makes it hard to impossible to exploid the full power of going micro-services in the back-end. For every new function you cannot just deploy the corresponding service, but you have the dependency to update and redeploy the service as well.

So I was looking around how to go micro in an SPA. One of the ideas I found on the web was to do so using web components. To evaluate this idea as someone working mainly on the backend I thought I should get some literature and bought the book Developing Web Components by Jarrod Overson and Jason Strimpel, O'Reilly Media, Inc., 2015.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

VDSL von der Telekom mit IPv6 und Debian

posted on

IPv6 is the new normal

Meine letzten IPv6-Tunnel werden langsam überflüssig. Seit letzter Woche haben wir auch im Büro natives IPv6. Die Telekom hat uns auf einen NGN-Anschluss umgestellt.

Setup

IPv6 aktivieren

Kurz zusammengefasst

Für den IPv6-Zugang muss der pppd IPv6 auf der PPP-Verbindung aktivieren. Die Telekom benutzt dann Router-Advertisements (radv) um dem ppp0-Device eine IPv6-Adresse zu geben. Soll IPv6 im LAN weiterverteilt werden, bekommen wir Präfixe hierfür über Präfix-Delegation per DHCPv6. Letzteres kann aber nicht als Ersatz für die Router-Advertisements genutzt werden, da die Telekom nur Präfixdelegation darüber macht.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Worin ich mich 2016 verbessere: Clojure und Softwaretests

posted on

Mein einer Vorsatz für dieses Jahr ist es die Philosophie von Clojure zu denken. Seit 2011 spiele ich mit Lisp und 2014 hatte ich meinen ersten Kontakt zu Clojure, einem der Dialekte von Lisp. Der andere ist, ich möchte meine Erfahrungen mit Softwaretests ausbauen. Bisher hatte ich vor allem an meinen Fähigkeiten mit Unit-Tests gearbeitet und hierfür meinen Stil gefunden. Jetzt will ich automatische Integrationstests in mein Standardrepertoire von Entwicklungstechniken aufnehmen.

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Vim, Emacs oder IDE (IntelliJ)?

posted on

In welchem Editor kann ich den besten Code schreiben? Vim wie bisher, doch vielleicht besser Emacs oder gar wie meine Kollegen mit einer IDE? Die letzten Wochen habe ich getestet: zwei Wochen nur Emacs und zwei Wochen nur IntelliJ als IDE

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Mein Weg zur testgetriebenen Entwicklung

posted on

Testgetriebene Entwicklung (TDD) funktioniert – überall. Sie scheitert nicht am Kunden, den nicht Qualität sondern Tempo interessiert. Sie steht nicht im Widerspruch zum jungen Projekt mit wenig Budget, das schnell Kunden gewinnen muss um zu überleben. Sie hindert nicht daran schnell Features umsetzen zu können. Ja, sie macht mir auch nicht (mehr) langsamer.

Es ist keine neun Monate her, dass ich das nicht glauben konnte. Mehrere Anläufe hatte ich unternommen neben Code auch Tests zu schreiben. Länger als zwei Monate ging das nie gut:

weiterlesen | read more | lee mas | lê mais | 閱讀更多 »

Tatort, una película alemana especial

posted on

Tatort es una palabra alemana que significa «lugar del crimen». Pero para un alemán en primer lugar es el nombre de una serie de películas policíacas que se emiten cada domingo a las ocho y cuarto en la televisión pública. Esta serie se emite desde 1970.

Su particularidad de esta telenovela es que no solo tiene un protagonista. La serie tiene lugar en 20 ciudades de Alemania, Austria y Suiza. Cada ciudad tiene un protagonista y también lo que ocurre en los episodios rodados en cada ciudad es muy diferente. En todos ellos se puede apreciar las peculiaridades de cada región. Algunos episodios tratan temas muy serios y otros son cómicos.

Esta serie es vista especialmente por la gente con un nivel de sociedad muy bien educada. Cuando llegaba a la universidad hablábamos cada lunes sobre el último capitulo de la serie.

Desde 1990 algunos episodios de Tatort tienen el nombre de «Polizeiruf 110». Porque ese fue el nombre que se le dío en la República Democrática Alemana. Además Alemania se reunificó en este año y se utilizan los dos nombres desde entonces.

Los autobuses con tráiler

posted on

Aquí en Múnich hay varios medios de transporte público: el autobús y el autobús articulado, el tranvía, el metro y el tren metropolitano. La diferencia entre estos medios es el aforo y si necesiten caminos especiales.

Desde el año pasado tenemos una variación nuevo: el autobús con tráiler. Tiene un aforo más grande que el autobús articulado. Pueden entrar unos 133 pasajeros (en comparación: tranvía 220, autobús articulado 100).

Es un renacimiento: hace 60 años hubo autobuses con tráiler en Múnich también.

El último martes vi este vehículo por primera vez. Aquí una foto.

El tráiler a la izquierda y el autobús a la derecha. La barrera en
medio.


Unless otherwise credited all material Creative Commons License by Matthias Wimmer