Beerup Microservices
Beerup Microservices
in an embedded system
(Stretching definitions)
Badics Alex
Avatar online:
“System Engineer”
“System” architect
Requirement “engineer”
Working at
Code shown was written by colleagues
Opinions are my own.
Definition of man
“Featherless biped”
Definition of Microservices
Micro: Service:
Single purpose
Self contained components
Small enough to be maintained by a
Encapsulated state
small team
Loose coupling
Message passing
Service contracts
Split along business requirements
Layered design vs. service oriented design
Frontend
Frontend
Remote API is just a set of exposed RPCs
Subscribe/notify
Implemented on top of RPC (not an integral part of it)
All notifications have a “type id” (e.g. message type)
Subscribers can subscribe to “all” or only specific ids
Any number of subscribers, using callback funtions
Most importantly: Notification sending code does not “know about”
or “depend” on notification using code
Used for: messages, station info, navigation data
Is this a man?
Is this a service interface definition?
Behind srv_wsmp_send: request part
Behind srv_wsmp_send: “server” part
But why?
Internal RPC == Remote API
Generated API bindings for Python and Java
This format is easily parseable
Type declarations
Well-formed “service declarations”
Is this a man?
Is this “message passing”?
srv_wsmp_send(...)
BSM sender module WSMP sender module
What is message passing anyway?
“Message passing is a technique for invoking behavior. The invoking program sends a message to a component
and relies on that component and its supporting infrastructure to then select and run some appropriate code.
Message passing differs from conventional programming where a process, subroutine, or function is directly
invoked by name.”
The caller code does not know what will happen in runtime
The “callee” decides on what code to run based on incoming parameters
Caller code does not depend on execution semantics
Simplest form: virtual functions on objects
See also: Smalltalk
Synchronous RPC calls in our system
If staying within process
Simple function call
Zero copy on parameters and data
No context switch, good cache coherency
If called component is in different process
Data serialized onto network
Parameters and result travel over network
Caller blocks until result
Code does not need to change when changing component/process splits
Is this a man?
Is this a microservices talk?
“Microservice architecture” is not about
“micro and “services”
Service-oriented modular architecture is
possible in C at almost zero cost