Coarse-grained and fine-grained

What is the difference between coarse and fine?

I searched these terms on Google, but I could not find what they mean.

+72
design api terminology granularity
Sep 22 '10 at 6:33
source share
8 answers

From Wikipedia (granularity) :

Granularity is the degree to which a system is divided into small parts, either of the system itself, or its description or observation. This is the extent to which a larger organization is subdivided. For example, a broken yard in inches has finer granularity than a yard broken into legs.

Coarse-grained systems are composed of smaller, larger components than fine-grained systems; a coarse-grained system description considers large subcomponents, while a fine-grained description refers to the smaller components of which the larger ones are composed.

+79
Sep 22 2018-10-22T00:
source share

In simple words

  • Coarse grained - larger components than fine grained, large subcomponents. It simply wraps one or more fine-grained services together in a coarser operation.
  • fine-grained - the smaller components that make up the larger, lower-level service

It is better to have coarser maintenance operations that consist of fine-grained operations

enter image description here

+17
May 27 '15 at 14:53
source share

Coarse Grained:. Several sites contain a wealth of interconnected data on why services have more functionality. Example. One โ€œAccountโ€ object contains a name, address, account balance, opening date, date of the last change, etc. Thus: Increased design complexity, fewer cells for various operations

Fine: More objects, each of which contains less data, so services have more narrow functionality. Example. The Account object has a balance, the Customer object has a name and address, the AccountOpenings object has an open date, etc. Thus: Reduced design complexity, more cells for various service operations. This is the relationship defined between these objects.

+14
Jan 13 '16 at 16:30
source share

In the context of services:

http://en.wikipedia.org/wiki/Service_Granularity_Principle

By definition, a large-scale service operation has a broader scope than a fine-grained service, although the terms are relative. the former usually requires increased design complexity, but can reduce the number of calls required to complete the task.

The interface with the fine-grained service is about the same as the chatty interface.

+3
Jan 20 '15 at 19:31
source share

Another way to understand is to think in terms of the relationship between processes and threads. Processes interact through coarse, granular communication mechanisms such as sockets, signal handlers, shared memory, semaphores, and files. On the other hand, threads have access to the shared memory space that belongs to the process, which allows them to use smaller mechanisms of grain exchange.

Source: Java concurrency in practice

+3
Mar 04 '15 at 18:39
source share

Coarse-grained granularity does not always mean larger components, if you literally understand the meaning of a rough word, it means rigidity or inappropriateness. For example, in project management software, if you break up a small system into several components that are equal in size but vary in complexity and features, this can lead to coarse granularity. Otherwise, for fine graining, you will separate the components based on their consistency in the functionality provided by each component.

+1
Sep 18 '15 at 13:59 on
source share

coarse-grained and fine-grained. Both of these modes determine how cores are shared between several Spark tasks. As the name implies, the fine-grained regime responsible for the joint use of nuclei on a more narrow level. Fine-grained mode is outdated by Spark and will be removed soon.

+1
Aug 22 '17 at 18:46 on
source share

In terms of a data set, such as a text file, the gross sense is that we can transform the entire data set, but not a single element in the data set. While fine-grained tools, we can convert a single element into a data set.

+1
Dec 13 '17 at 16:10
source share



All Articles