Posts

Efficient Memory Mapping for Terabyte Sparse Files in Java

Image
  On Linux, you can create  sparse files , where only the pages (of 4 KiB) that are touched utilise either memory or disk space. This allows you to memory map large virtual regions without worrying about wasted memory or disk In this program, you can see it reserves 8 TiB (8,192 GiB) Figure 1.  Test 1: Sparse file Tip:  x << y means x × 2 y  therefore  1L << 10 = 1 KiB (1024 bytes),  1L << 20 = 1 MiB (1024 2  bytes),  1L << 30 = 1 GiB (1024 3  bytes),  1L << 40 = 1 TiB etc Using multiples of 10 for the shift makes them easier to read.  64L << 20 is 64 × 2 20  = 64 × 1024 2  = 64 MiB.  The virtual memory size of the above process is just over 8192 GiB at 8200.7 GiB, but the RSS (Resident Set Size) is only  122,060  KB, or 122  MB. Figure 2. RES for Test 1 On disk, the extents reported are 8 TiB, however the amount of disk (and memory) actually used is just 20 KiB....

Event Driven Hello World Program

Image
  Event-driven microservices  can be straightforward to describe before they are implemented, tested and maintained. They are also highly responsive to new information in real-time, with latencies in Java of below 10 microseconds 99.99% of the time, depending on the functionality of the small, independently deployable microservice.    In this introductory article, we use an example  event-driven   Hello World  program ( a programming paradigm where the program flow is determined by events)  to step through   behaviour-driven   development , where we describe the behaviour the business needs first as test data and write a very simple  microservice  which turns input events like this. say: Hello World Into outputs like this, by adding an exclamation point say: Hello World !  # <- adds an exclamation point All the code for this example is  available on GitHub . When modelling Event-Driven systems, a useful pattern is ...

How Behaviour Driven Development Works Well with Event Driven Architectures

Image
  Behaviour Driven Development (BDD) and Event-Driven Architecture (EDA) work well together as they complement each other’s strengths and weaknesses. Using both can result in a shorter time to market for new functionality and a more maintainable system. Behaviour Driven Development  encourages a common language between users and developers in describing requirements in a form the users can understand but can also automatically be checked as the application is developed and maintained. BDD increases the inclusion of users, focuses on requirements capture and maintains the development velocity as the application increases in complexity. Figure 1. Behaviour Driven Development for the high level with Test Driven Development for the low level   Table 1. Pros and Cons of Behaviour-Driven Development   Event-Driven Architecture  models interactions between services as events. Events are facts about something that happened to represent a state change, such as an order p...

The More You Say, the Less People Remember The Fewer the Words, the Greater the Profit

Image
These wise words were written by François Fénelon, a writer and theologian living during the 17th century. This is an article summarising different approaches to the development of IT solutions. Learn why the above quote is very relevant for developers in the 21st century.   Business-driven development  is a meta-methodology for developing IT solutions that directly satisfy  business requirements . This leads to increased flexibility and shorter turnaround times when changing the business and adapting the IT systems.    This is achieved by adopting a  model-driven  approach that starts with the business strategy, requirements and goals and then refines and transforms them into an IT solution. Due to the alignment of the business and IT layers, it is possible to propagate changes in the business automatically to the IT systems.    This is partially replaced by Domain-Driven Design and Behaviour Driven Development in Agile terminology.  ...