$ whoami Colin FAY Data Scientist & R-Hacker at ThinkR, a french company focused on Data Science & R. Hyperactive open source developer. http://thinkr.fr http://rtask.thinkr.fr http://twitter.com/_colinfay http://github.com/colinfay Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 2 / 24
Data Science engineering, focused on R. Training Software Engineering R in production Consulting ThinkR Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 4 / 24
Today's schedule What this talk is not about: Technical details Microservices deployment What this talk is about: What's a microservice Why you should care How to get started building an R microservices Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 5 / 24
What's a Microservice? Microservices are a software development technique (...) that structures an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight. https://en.wikipedia.org/wiki/Microservices Something which is: Lightweight Good for one task Easy to scale Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 7 / 24
The good Lightweight Easier to maintain, to change, and to scale Not linked to an infrastructure The bad More communication management More architecture needs Microservices The ugly The "distributed monolith" Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 8 / 24
R and Microservices, why? Make your R algorithm, graph, data output... language agnostic: integrate it to other services Don't depend on your machine's configuration Build tools with different versions of a package which still work together Simplify your code base You're going to sound cool Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 10 / 24
R and Microservices, how? The central thing about microservice is communication. Don't think about the language, think about the data Take text as input, and output text (JSON) Or use a "universal" format like arrow Every piece should fail gracefully Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 11 / 24
R and Microservices, how? The UNIX philosophy: Unix tradition strongly encourages writing programs that read and write simple, textual, stream-oriented, device-independent formats. Under classic Unix, as many programs as possible are written as simple filters, which take a simple text stream on input and process it into another simple text stream on output. The Art of UNIX Programming Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 12 / 24
R and Microservices, tools R package is a micro service by itself package::function() Colin FAY (@_ColinFay) - WhyR 2019 - https://rtask.thinkr.fr 16 / 24