Microservices. The boundaries.
One of the problems with designing and implementing a distributed software system using microservices implementation technique is figuring out the boundaries of microservices. And, indirectly, the size of these artifacts.
What happens if the boundaries are incorrect? You get coupling between various components (microservices) – both spatial and temporal. Such coupling can undermine a lot of implementation and delivery aspects. Some of these include inability for one team to fully implement a feature due to a dependency on some other service that implements something they require, inability to release without coordination with other teams, issues when releasing interdependent components may and will result in instability, loss or corruption of data, emergence of distributed transactions, etc. Many tried, many failed and questioned the concepts rather than their misunderstanding or mistakes.
So, is the concept flawed? Is there something that can help us deal with such issues? As always we need to start with the foundation. In this case our main foundational concept comes from Domain Driven Design – an Aggregate.
If you don’t know what Domain Driven Design is, or have a very basic, high level knowledge of it, it is crucial for you to start digging deep and wide, over and over, to start understanding what it’s all about. It is a philosophy of successfully modeling complex business domains and implementing those in software. There is a lot written on the subject and I would recommend to keep reading.
An aggregate is a very important, yet somewhat elusive concept that takes time to fully grok. At it’s core DDD Aggregate ensures the boundary for transactional consistency. When a transaction completes all entities represented by an aggregate must be in a consistent state – any business rules governing the state must be met, the data must be fully stored in a data store and the aggregate should be fully available for any other use case. From the implementation point of view, an aggregate is one or more classes representing an entity(-ies) that govern the state and the rules associated with it.
With the concepts of DDD Aggregate in mind we can now approach the sizing of a microservice and define its boundaries. Approaching the design thinking about the business process that drives the implementation we really localize the scope of change, encapsulate the logic and state. The implementation become autonomous, we remove any potential for cross-service requests, complex orchestration goes away, unnecessary generalization of code is not a factor anymore. The codebase becomes simpler, more robust, easier to reason about. It is easier to test, easier to maintain all of which really yields greater business agility – exactly what business asks of engineering.
So, why do people run into issues we’ve mentioned at the beginning of this post? It usually happens when implementation is based on technical concerns or driven by popular but often superfluous concepts such as code reuse, DRY, generalization, centralization of some logic. With this the chances of incorrect breakdown of business process into reusable parts may and will result in the issues that lead microservices solution to become overly complex – invalid services boundaries, coupling between services, emergence of distributed transactions, dependencies on other components and teams, lack of agility. Pretty much everything that the concept promises to solve and the reason you’ve decided to adopt it in the first place.
Disclaimer: I am a strong believer that microservices is an implementation technique, not an architectural style. As such, without proper foundation it most likely will cause more harm than good. More on this here.
Microservices without fundamentals
Couple weeks ago an article was brought to my attention. An article with a catchy title – “The Death of Microservices Madness in 2018”. Since I am greatly interested in software architecture for distributed software systems such statements are definitely too bold to be ignored.
One of the biggest misconceptions about Microservices I’ve observed is that people accept the idea as something holistic, self-contained and self-sufficient. In reality, Microservices is just an implementation approach for distributed systems architected and designed according to much wider concepts – Service Oriented Architecture, Event Driven Architecture, Domain Driven Design. Looking at microservices in a disconnect from these architectural styles is a mistake that will become costly and may lead to an ultimate failure. More on this here.
Read More»Microservices as a self sufficient concept
Over the past few years microservices became a very hot topic in development communities. More and more people talk about the approach and attempt to build large software systems according to various patterns published by enthusiasts. The buzz words (and buzz concepts) are a big driving force in software development, which in a lot of cases results in failures, as people simply don’t research and learn the subject deep enough to be able to make informative decisions. I think one of the concepts suffering from such high level approach is distributed systems development, which some are trying by going with microservices model.
I am greatly interested in software architecture for distributed enterprise-level systems and I believe that microservices concept has not only been greatly misunderstood by many, but also is flawed in the way it is presented – as a self sufficient “architecture”. However, microservices is merely an implementation approach and without proper fundamentals will not magically lead you to success. What are those fundamentals you may ask? Well, read on – this is not going to be very long, even though each of the fundamentals is a very large subject.
Read More»Aeon MQ7 Kodi и русские шрифты
- At February 13, 2018
- By Alexander Yermakov
- In HTPC, Kodi
0
Одним из больших улучшений медиа системы на основе Kodi является возможность изменять внешний вид с помощью разнообразных skin-ов. Я использую Kodi / XBMC вот уже много лет, и на протяжении долгого времени моей любимой skin остаётся Aeon. На данное время (начало 2018 года) последней версией является Aeon MQ 7, которую разрабатывают активисты в Бразилии. К сожалению, по умолчанию, русский язык толком не поддерживается – есть возможность выбрать шрифт, отображающий русский язык в основных меню, однако этот шрифт сильно отличается на оригинального, и не работает в некоторых экранах.
Мне попался архив с русскими шрифтами для Aeon MQ 7 – Aeon MQ7 Russian fonts
Для установки этих шрифтов, вам надо заменить оригинальные шрифты с тем же именем в папке /kodi/addons/skin.aeonmq7/fonts. Я использую LibreElec, на основе Linux, так что эта папка находися в домашнем каталоге пользователя root (вам надо подключиться по ssh и переписать шрифты в данную папку).
После установки шрифтов зайдите в настройки и выберите “стандартные” шрифты для skin – после этого интерфейс обновится и будет использоваться шрифт с поддержкой русского языка.
Windows update breaks GRUB on dual boot machines
It’s pretty widely known that major Windows updates may affect dual boot machines. This is what I’ve run into with my dual boot machine – Windows decided to install a major update and in doing that broke GRUB that managed my boot options.
Few google searches later I’ve run across many ways of addressing the GRUB issue, which seem to be stemming from various failures.
What I was greeted with was GRUB command line with the following message:
error: file ‘/grub/i386-pc/normal.mod’ not found
and the prompt:
grub rescue>
In short, the following is the sequence of steps I needed to take:
- First, run this command to see the list of disks and partitions:
ls
- You’ll get a list of devices and partitions in the form of: (hd0), (hd0,msdos1),etc.
- Most likely your GRUB root partition is on (hd0)
- You need to figure out which partition that is.
- Run the following command:
ls (hd0,msdos0)
- If you get “error: unknown filesystem”, then move onto the next partition –
ls (hd0,msdos1)
- If you get “Filesystem is ext2” then you found one of Linux partitions – you may have more than one on a single drive, obviously. Most likely your root partition is the one with the smallest index.
- Run the following command:
- Run the following commands to run GRUB (assuming your root partition is msdos1):
set boot=(hd0,msdos1) set prefix=(hd0,msdos1)/boot/grub insmod normal normal
- At this point you should see your GRUB screen, which allows you to pick the OS to boot.
However, this is not all. Following these steps you won’t “fix” the issue – you’ll just manually run GRUB. To permanently fix the issue and make sure you don’t have to follow these steps on every single boot. Assuming your root partition is on /dev/sda, run the following (note that it’s all about the device, not a partition on it):
sudo grub-install /dev/sda sudo update-grub
So, at this point your system should be back to normal.
One more comment – if you run into this while upgrading Windows to the next major version, it doesn’t make sense to finalize the fix until Windows is done with its reboots (it does it few times during the upgrade), as it may damage GRUB again.