Kubernetes Patterns-Distributed Primitives(k8s模式-分布式原语)

To explain what we mean by new abstractions and primitives, here we compare them with the
well-known object-oriented programming (OOP), and Java specifically. In the OOP universe, we
have concepts such as class, object, package, inheritance, encapsulation, and polymorphism. Then
the Java runtime provides specific features and guarantees on how it manages the lifecycle of our
objects and the application as a whole.
The Java language and the Java Virtual Machine (JVM) provide local, in-process building blocks for
creating applications. Kubernetes adds an entirely new dimension to this well-known mindset by
offering a new set of distributed primitives and runtime for building distributed systems that
spread across multiple nodes and processes. With Kubernetes at hand, we don’t rely only on the
local primitives to implement the whole application behavior.
We still need to use the object-oriented building blocks to create the components of the distributed
application, but we can also use Kubernetes primitives for some of the application
behaviors. Table 1-1 shows how various development concepts are realized differently with local
and distributed primitives.

The in-process primitives and the distributed primitives have commonalities, but they are not
directly comparable and replaceable. They operate at different abstraction levels and have different
preconditions and guarantees. Some primitives are supposed to be used together. For example, we
still have to use classes to create objects and put them into container images. However, some other
primitives such as CronJob in Kubernetes can replace the ExecutorService behavior in Java
completely.

发布了296 篇原创文章 · 获赞 178 · 访问量 124万+

猜你喜欢

转载自blog.csdn.net/doctor_who2004/article/details/104461280
今日推荐