- Optimistic Nihilist.
- Wannabe Astrophysicist.
- I code for fun & profit.
- I love Science, Python, FOSS & fitness.
- Dad of 2. Environmentalist. Story Teller. Gamer.
- http://dhilipsiva.com
- [email protected]
- I am assuming that everyone has a basic understanding of a microservice architecture
- For the uninitiated, it is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities. The microservice architecture enables the continuous delivery/deployment of large, complex applications. It also enables an organization to evolve its technology stack.
- I am just talking about small & medium startups [The only space that I have experience with]
- CLI, HTTP, RPC, Thrift
- Call a command line/console application with Popen or something similar
- Very notorious (because we have limited control over the called program)
- Scaling is a bit tricky
- Build a REST / SOAP endpoint
- Document the message exchange format (which is a manual process and might be error prone)
- relatively easier to scale compared to CLI method
- Build RPC Server and clients
- Just as easy to scale as HTTP method, but this is faster because of strongly typed messages serialize and deserialize very fast and data is smaller compared to JSON / XML
- Relatively harder (Implementation wise) because of all the learning curve involved
- We have well-defined Data schemas; So manual intervention is not required to communicate changes
- How to make the RPC Implementation relatively easier
- Introducing Garuda
- Automagically Exposing Django ORM over gRPC for microservices written in any other languages
- It's done with the help of gRPC (for now). So you need to understand Protobuf, gRPC and the likes.
- gRPC: A high performance, open-source universal RPC framework
- Cap'n Proto: Cap'n Proto is an insanely fast data interchange format and capability-based RPC system.
- Protocol Buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.
message Article {
string id = 1;
string content = 2;
int32 status = 3;
string title = 4;
}
Service Definition
service Blog {
rpc CreateArticle (Article) returns (Article) {}
rpc UpdateArticle (Article) returns (Article) {}
}
- Documentation
- Cap'n Proto Backend
- Complex queries
This copy is released under the MIT License