Home » #learning » Page 8

#learning

Lock Interface

The lock interface is one of the most used interfaces in Java. Lock interface is available in the Java.util.concurrent.locks package which we use as a thread synchronization mechanism, i.e., similar to synchronized blocks. It is more flexible and provides more options in comparison to the synchronized block. It allows us to gain the benefit of fine-grained locking without having […]

Lock Interface Read More »

Fork/Join Framework

Java 7 introduced the fork/join framework. It is among the simplest and most effective design techniques for obtaining good parallel performance. Fork/join algorithms are parallel versions of familiar divide−and−conquer algorithms. The fork operation starts a new parallel fork/join subtask. The join operation causes the current task not to proceed until the forked subtask has completed.

Fork/Join Framework Read More »

Java Executor Framework

Java concurrency API includes the executor framework since java  5 to improve the performance of concurrent applications with a lot of concurrent tasks. It is a mechanism that allows you to separate thread creation and management for the implementation of concurrent tasks. You don’t have to worry about the creation and management of threads, only

Java Executor Framework Read More »

Synchronization in Java

Synchronization is the coordination of two or more tasks to get the desired results. We have two kinds of synchronization: synchronization helps you avoid some errors you can have with concurrent tasks but it introduces some overhead. You have to calculate very carefully the number of tasks, which can be performed independently without intercommunication in

Synchronization in Java Read More »

MultiThreading

When we create an application, we write lines of code and logic is also correct. But still we wonder that our application is not upto the mark. One important factor that plays a vital role in any application development is its Performance.However the performance of an app is not only related to the number of

MultiThreading Read More »

Microservices

41. What is the role of web and RESTful APIs in Microservices?A microservice architecture is based on a concept wherein all its services should be able to interact with each other to build a business functionality. So, to achieve this, each microservice must have an interface. This makes the web API a very important enabler

Microservices Read More »

Microservices

31. How to maintain ACID transactions in Microservices?ACID is an acronym for four primary attributes namely atomicity, consistency, isolation, and durability ensured by the database transaction manager.  In a distributed system involving multiple databases, we have two options to achieve ACID compliance:  2 Phase Commit should ideally be discouraged in microservices architecture due to its

Microservices Read More »

Microservices

11. How can we test the Microservices based architecture?One should have unit and integration tests where all the functionality of a microservice can be tested. One should also have component based testing.One should have contract tests to assert that the expectations by the client is not breaking. End-to-end test for the microservices, however, should only

Microservices Read More »

Microservices

1. What are Microservices?Microservices is an architectural style which structures and application as a collection of loosely coupled, independently maintainable, testable and deployable services which are organized around business capabilities. If you have a business focus and you want to solve a use case or a problem efficiently without the boundaries of technology, want to scale

Microservices Read More »

Spring

41. Differentiate between WebClient and WebTestClient?The difference between the Web client and Webtestclient can be stated as follows. Web client Webtestclient Web client acts as a reactive client who performs non-blocking HTTP requests.  Webtestclient also acts as a reactive client that can be used in tests. It can handle reactive streams with backpressure. It can

Spring Read More »

Scroll to Top