Architecture

Microservice’s independent scaling can improve overall performance. But how, and how much ? – part 3, more discussion

Caveats of “they perform the same” As you can see in the previous 2 articles (part1 and part2), distributed mode and bundled mode sometimes have the same performance. However, most of “the same performance” scenarios are based on this assumption: For a single service if the computer hardware is twice as good, then the performance …

Microservice’s independent scaling can improve overall performance. But how, and how much ? – part 3, more discussion Read More »

Microservice’s independent scaling can improve overall performance. But how, and how much ? – Part 2, different minimum computing resource

In previous article we brought up the question, and we had a conclusion: In this article we’ll example how it is like if the services have different minimum computing resources TL;DR See conclusion Method and Assumptions The methods and assumptions are basically the same as previous article . Difference is A and B here will …

Microservice’s independent scaling can improve overall performance. But how, and how much ? – Part 2, different minimum computing resource Read More »

Microservice’s independent scaling can improve overall performance. But how, and how much ?

People say if you separate services and let them scale independently, you can will get better performance by allocating what’s needed and no computation resources will be wasted. But how exactly? And how much gain will there be compared to a monolithic solution? This article will do a quantified research. TL;DR See conclusion Method Let’s …

Microservice’s independent scaling can improve overall performance. But how, and how much ? Read More »

Library dependency V.S. Remote API dependency in SOA

Pros of Library Dependency: Simplicity in terms of implementation. In java, all you need is Maven. There is no need for any RPC serialiser or RPC middleware.  Simplicity in terms of deployment. You will need less applications than the RPC approach. Each application requires investment of auto-deployment, monitoring, hardware resources, and load balancing in some …

Library dependency V.S. Remote API dependency in SOA Read More »

Layering in Java Webapps – My Final Version

What a good layering solution should do It must handle the following problems: 1. Dividing a system into layers based on modularization principles, such as single-direction dependency, limited entry of components and so on.  2. Compatible with modern dependency management tools such as Maven  3. Allowing for evolving into a distributed system in the future  …

Layering in Java Webapps – My Final Version Read More »

How to signify the end of a self-defined message in TCP programming?

TPC’s data transfer is based on stream. If the two sides don’t agree on how to detect the end of self-defined message, the receiver won’t know the boundary of a message.  A simple way is to have a special character is the ending flag, such as "2 new lines". The problem is that the message …

How to signify the end of a self-defined message in TCP programming? Read More »

集群环境下慎用本地缓存

集群环境下慎用本地缓存。 用户1在机器A上看到100条记录,用户2在机器B上看到的却是90条记录。 你会说你的业务允许两边看到不一样。 是的,两个用户看到的不一样不要紧。 但是同一个用户看到不一样的话,用户体验会非常差,差到要骂人。 例子是:用户1在机器A上提交表单删除100条记录,服务端处理完毕后让浏览器跳转(Redirect after Submission),负载均衡将这个请求跳转到机器B上,机器B上的本地缓存没变,所以仍然是删除前的记录数。 用户1看到这个结果,脑子里只有一个想法:删除没起作用。 所以,集群环境下使用本地缓存,一定要保证同一个用户先后访问的是同一台机器。