Vanilla Java Blog
22 FOLLOWERS
This blog is all about Understanding how Core Java really works can help you write simpler, faster applications. Find tutorials and guides on core java, news and updates and more!
Vanilla Java Blog
1y ago
A significant feature of Chronicle Queue Enterprise is support for TCP replication across multiple servers to ensure the high availability of application infrastructure. I generally believe that replicating data to a secondary system is faster than syncing to disk, assuming the round trip network delay wasn’t high due to quality networks and co-located redundant servers. This is the first time I have benchmarked it with a realistic example.
Little’s Law and Why Latency Matters
In many cases, the assumption is that the latency won't be a problem as long as throughput is high enough. Howev ..read more
Vanilla Java Blog
1y ago
Following the Hello World example of a simple, independently deployable real-time Event-Driven Microservice, this article looks at a more realistic example of an Order Processor with a New Order Single in and an Execution Report out.
A New Order Single is a standard message type for the order of one asset in the FIX protocol used widely by financial institutions such as banks. The reply is typically one or more Execution Reports updating the status of that order.
Some Background on Fintech
In fintech, when one organisation wishes to purchase an asset o ..read more
Vanilla Java Blog
1y ago
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 × 2y therefore
1L << 10 = 1 KiB (1024 bytes),
1L << 20 = 1 MiB (10242 bytes),
1L << 30 = 1 GiB (10243 bytes),
1L << 40 = 1 TiB etc
Using multiples of 10 for the shift makes th ..read more
Vanilla Java Blog
1y ago
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 describ ..read more
Vanilla Java Blog
1y ago
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 ve ..read more
Vanilla Java Blog
1y ago
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&nbs ..read more
Vanilla Java Blog
2y ago
My previous post with Eight Core Java Questions was popular so I created nine more.
Please join the discussion of the answers for these questions on Twitter
1.
Comment on this question
How many elements does this set have?
Set set = new HashSet(Arrays.asList( -0, +0, -0L, +0L, -0F, 0F, -0D, 0D, 0xF, 0xD, 0x0.DP+0));System.out.println(set.size());
12
1
6
9
2.
Comment on this question
This compiles in Java 17 due to
static int[] a(int[]... a)[] { return a; }static final int one = a(new int[0]).length; // 1
It confuses the compiler
It’s a static method
Backward Compatibility
JEP 74 ..read more
Vanilla Java Blog
2y ago
Please join the discussion of the answers for these questions on Twitter
The answers to each question can be combined for a bonus question at the end.
1.
Which of these is NOT a means of communicating between processes in Core Java. Comment on Twitter
UDP
Pipes/Files
Pass by reference
TCP
2.
Which of these methods of copying an object is the LEAST efficient? Comment on Twitter
Java Serialization
clone()
Copying field by field
Using a builder
3.
Which of these is the lowest amount of time Comment on Twitter
A micro-day
A nano-year
0.001 seconds
A millsecond
A million nanoseconds
100 micro ..read more
Vanilla Java Blog
2y ago
Apache Kafka is a common choice for inter-service communication. Kafka facilitates the parallel processing of messages and is a good choice for log aggregation. Kafka claims to be low latency, high throughput. However, is Kafka fast enough for many microservices applications in the cloud?
When I wrote Chronicle Queue Open Source my aim was to develop a messaging framework with microsecond latencies, and banks around the world have adopted it for use in their latency-sensitive trading systems.
In this article, I will describe how Kafka does not scale in terms of throughput as easily as Chronic ..read more
Vanilla Java Blog
2y ago
Recently I published an article on using timestamps as unique identifiers, generated in a fraction of a microsecond. This article covers an implementation that supports distributed identifier generation directly.
This specific implementation supports up to one billion new 64-bit identifiers every second only repeating after 520 years. They can also be printed as timestamps containing the wall clock to make it easier to read.
Concurrent identifier generation in a distributed system
Each host has a predefined, unique host identifier, or hostId.
This TimeProvider assumes up to 100 hosts to produc ..read more