Articles

Load Average‘ is an age-old metric reported in various operating systems. It’s often assumed as a metric to indicate the CPU demand only. However, that is not the case. ‘Load Average’ not only indicates CPU demand, but also the I/O demand (i.e., network read/write, file read/write, disk read/write). To prove this theory, we conducted this simple case study.

Load Average Study

To validate this theory, we leveraged BuggyApp. BuggyApp is an open-source Java project that can simulate various performance problems. When you launch BuggyApp with the following arguments, it will cause high disk I/O operations on the host.

Source de l’article sur DZONE

The best way to protect your Java code from avoidable bugs is to use static code analysis tools that can help you find and fix problematic code before it reaches production. Let’s look at some popular static code analysis tools that can be used to test code from a number of different angles.

DeepSource

DeepSource delivers what is probably the best static code analysis you can find for Java. The DeepSource Java analyzer detects 190+ code quality issues, including performance bugs, security risks, bug risks, and anti-patterns. Currently, It supports Gradle Java projects, and in the future, DeepSource will add support for Maven and Android too. DeepSource is also working on bringing Autofix support to the Java analyzer, which will let developers fix issues without writing a single code line.

Source de l’article sur DZONE

If you are building an application using Node.js, it can get a little overwhelming since there are a variety of databases to choose from and different ways to build APIs. One way to reduce development time and focus on the problem you are trying to solve is to use a Database as a service to store the data. The advantage of this approach is to use a cloud database system without purchasing hardware which can be cost and time-effective.

One such database service is HarperDB Cloud. To build REST APIs rapidly this service allows us to perform all database operations using a single endpoint. It supports a variety of programming languages such as JavaScript, Java, Python, and so on. Some of the features of HarperDB are the following:

Source de l’article sur DZONE

I was facing a problem where I wanted to insert millions of records into the database, which needed to be imported from the file.

So, I did some research around this, and I would like to share with you what I found which helped me improve the insert records throughput by nearly 100 times.

Source de l’article sur DZONE


Overview

EclipseLink has two types of caches: the shared cache (L2) maintains objects read from database; and the isolated cache (L1) holds objects for various operations during the lifecycle of a transaction. L2 lifecycle is tied to a particular JVM and spans multiple transactions. Cache coordination between different JVMs is off by default. EclipseLink provides a distributed cache coordination feature that you can enable to ensure data in distributed applications remains current. Both L1 and L2 cache store domain objects.

“Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams.” — redis.io

Source de l’article sur DZONE

In this article, you will see how to create a UUID in Java.

Introduction

A UUID, or a universally unique identifier, is a 128-bit number used to identify information in computer systems.

Source de l’article sur DZONE

Let’s say that we have a UserController class with two GET endpoints:

  • /users/{id} endpoint, which returns a User object for a given id
  • /users endpoint, which returns List<User>
Java

 

xxxxxxxxxx
1

26

1

public class User {

2


3

    private Integer id;

4

    private String name;

5

    private Date dateOfBirth;

6

    private String city;

7

    

8

    // constructors, getters & setters are ignored

9

}

10


11

@RestController

12

public class UserController {

13

    

14

    @Autowired

15

    UserService userService;

16

    

17

    @RequestMapping(value = "/user/{id}", method= RequestMethod.GET)

18

    User getUser(@PathVariable("id") String id){

19

        return userService.getUser(id);

20

   }

21

    

22

    @RequestMapping(value = "/users", method= RequestMethod.GET)

23

    List<User> getAllUsers(){

24

        return userService.getAllUsers();

25

   }

26

}

Source de l’article sur DZONE