Наука и технология в современном миреМирзаева Ширин Нодировна, Тахиров Чингиз Аъзамович +22026
PROTO REFLECTION IMPLEMENTATION FOR DYNAMIC INTERACTION WITH GRPC SERVICES IN HIGH-LOAD SYSTEMS
Kish Aleksei
The American Journal of Engineering and Technology · 06 · 2024
Аннотация
INTRODUCTION languages, Swift does not provide built-in In the modern era of high-load systems and mechanisms for dynamically generating code from microservice architecture, the efficiency of `.proto` files at runtime. This means that all interactions between services has become a messages and services must be generated during priority. The gRPC protocol, based on the binary compilation, making it challenging to work with serialization Protocol Buffers, offers impressive dynamic or frequently changing data structures advantages: it can be up to eight times faster than [4]. traditional JSON serialization, and message sizes are reduced by 60–80% [1,2]. This is achieved Additionally, Swift’s limited reflection capabilities, through the efficient use of HTTP/2 features such particularly in the context of Protocol Buffers, as request multiplexing and header compression complicate the implementation of general [3]. serialization and deserialization mechanisms and the dynamic creation of messages based on their However, despite these technical advancements, types. Certain data types may not be fully Swift developers face significant limitations when compatible with Swift, requiring additional working with Protocol Buffers. Unlike some other https://www.theamericanjournals.com/index.php/tajet 84 THE USA JOURNALS THE AMERICAN JOURNAL OF ENGINEERING AND TECHNOLOGY (ISSN – 2689-0984) VOLUME 06 ISSUE12 transformations that could lead to performance concept of efficient inter-service communication degradation [5]. Integrating Protocol Buffers into using Protocol Buffers and gRPC. Protocol Buffers existing projects may also require substantial is a mechanism for serializing structured data, codebase modifications, especially if binary where each message is defined through a proto file serialization protocols were not initially planned. containing strictly typed descriptions of the data structure. This format provides significant In a world where service APIs evolve at an performance advantages over JSON or XML due to incredible pace, static interaction methods become its binary data transmission format [2]. a bottleneck in the development process. The need to recompile applications and regenerate classes The fundamental principle of Protocol Buffers is with each API change not only slows down the the use of a specialized interface definition release of updates but also hinders rapid language (IDL) that allows for the description of adaptation to changing market requirements. data structures independently of programming languages or platforms. Each field in a message is The goal of this work is to present the assigned a unique number, type, and name, SwiftProtoReflect library, which implements Proto ensuring backward compatibility as the protocol Reflection for dynamic interaction with gRPC evolves. An important aspect is its support for services in Swift. This innovative solution allows complex data types, including nested messages, developers to dynamically explore and interact enumerations, repeated fields, and associative with services and methods without the need to arrays [6]. generate static classes from `.proto` files using `protoc`. As a result, server-side changes no longer gRPC, built on Protocol Buffers, implements the require recompilation and code updates on the concept of remote procedure calls over HTTP/2. A client side, significantly accelerating development key feature is its support for four interaction types: and deployment processes. unary requests, server streaming, client streaming, and bidirectional streaming. The use of HTTP/2 METHODS provides advantages such as request multiplexing, Modern distributed systems are built on the stream prioritization, and header compression [2]. https://www.theamericanjournals.com/index.php/tajet 85 THE USA JOURNALS THE AMERICAN JOURNAL OF ENGINEERING AND TECHNOLOGY (ISSN – 2689-0984) VOLUME 06 ISSUE12 Figure 1 - Proto Reflection Mechanisms to service metadata through a dedicated reflection The Proto Reflection mechanism represents an service [7]. innovative approach to dynamically exploring the structure of services and messages. It is based on The theoretical foundation of Proto Reflection the concept of metaprogramming, enabling the encompasses several key concepts. The first is retrieval of information about data types and dynamic typing, which allows interaction with data methods at runtime. This mechanism leverages types without their prior declaration in code. The advanced reflection capabilities, providing access second is service introspection, enabling the https://www.theamericanjournals.com/index.php/tajet 86 THE USA JOURNALS THE AMERICAN JOURNAL OF ENGINEERING AND TECHNOLOGY (ISSN – 2689-0984) VOLUME 06 ISSUE12 exploration of available methods and their necessitates the development of specialized signatures. The third is data solutions [7]. serialization/deserialization, facilitating Additionally, increased computational resource conversion between binar
Доказательный фрагмент
«INTRODUCTION languages, Swift does not provide built-in In the modern era of high-load systems and mechanisms for dynamically generating code from microservice architecture, the efficiency of `.proto` files at runtime.»
Образец извлечения
Демо-превьюINTRODUCTION languages, Swift does not provide built-in In the modern era of high-load systems and mechanisms for dynamically generating code from microservice architecture, the efficiency of `.proto` files at runtime. Полный текст публикации CiteX не хранит — доступ к первоисточнику открывается по DOI согласно лицензии издателя и выбранному плану.
- Цитирований
- 0
- Тип
- Журнал
- Страна
- Узбекистан
- Ключевые слова
- proto reflection, Swiftprotoreflect, protocol buffers
Смежные источники
Магистерские диссертацииРахмонов Сардорбек Рахимжон ўғли2016
in LibraryЭКАНОМИКА И ОРГАНИЗАЦИЯ СТРОИТЕЛЬСТВО, QURILISHDA TAVAKKALCHILIKNI BOSHQARISHNING BIZNESDAGI AHAMIYATI2021
Медицина и инновацииМ Сабиров, О Скосырева +12021