$30 off During Our Annual Pro Sale. View details »

Jun2022 [Video]: Build a massively scalable C++ remote compiler cloud by Damien Buhl

Jun2022 [Video]: Build a massively scalable C++ remote compiler cloud by Damien Buhl

Recording: https://www.youtube.com/watch?v=Sj1ymo_POPc
Meetup: https://www.meetup.com/de-DE/microsoft-azure-zurich-user-group/events/286206018/

Abstract:
Damien will talk about the journey implementing a massively scalable web application for tipi.build, in a mixed environment with many cloud vendors, REST APIs and cloud integration in Azure. Contents are C++ web frameworks, REST server autogeneration, template metaprogramming and the learnings of building and running a rock solid cloud application with C++ and containers swarms.

Bio:

Damien (aka daminetreg), co-founder and CEO from tipi.build is an enthusiast C++ developer. He is Opensource entrepreneur, CppCon Speaker, GameMaker.fr community founder, Qt for Android contributor and Boost.Fusion maintainer since 2014

Links:

https://tipi.build
https://www.linkedin.com/company/tipi-technologies
https://github.com/tipi-build/
https://twitter.com/TipiBuild

Azure Zurich User Group
PRO

June 21, 2022
Tweet

More Decks by Azure Zurich User Group

Other Decks in Technology

Transcript

  1. 1 tipi.build @ Azure Zürich User Group Building a massively

    scalable C++ remote compiler cloud www.tipi.build Damien Buhl damien@tipi.build +41 (0) 78 984 08 13 Azure Zürich User Group 21.06.2021
  2. 2 tipi.build @ Azure Zürich User Group Our Founders Damien

    Buhl CEO & CTO Yannic Staudt COO & Business Development
  3. Agenda 3 tipi.build @ Azure Zürich User Group • Why

    C++ for Webapps ? • tipi.build software architecture • JWT • REST • OpenAPI • ORM Our Adventures building a massively scalable C++ remote compiler cloud
  4. 3 problems with C & C++ 4 tipi.build @ Azure

    Zürich User Group
  5. Code Reuse 5 tipi.build @ Azure Zürich User Group Comics

    from Monkeyuser.com
  6. Dependencies & Environments 6 tipi.build @ Azure Zürich User Group

    Comics from Monkeyuser.com
  7. 7 tipi.build @ Azure Zürich User Group Monkeyuser.com

  8. Build & Deploy Time 8 tipi.build @ Azure Zürich User

    Group Comics from xkcd.com
  9. Why C++ for webapps ? 9 tipi.build @ Azure Zürich

    User Group
  10. 10 tipi.build @ Azure Zürich User Group

  11. Seriously ! Why C++ for webapps ? 11 tipi.build @

    Azure Zürich User Group
  12. 12 tipi.build @ Azure Zürich User Group Carbon footprint Enabling

    environmentally friendly software PHP, 77% Lua, 8% Java, 5% Ruby, 5% Python, 3% Typescript / Node.js, 1% Others, 1% 186M Of all internet requests by seconds served by non-native technologies globally 3 1.32bn CO2 tons Yearly Global Emissions by Internet 1 47’000 CO2 tons Yearly Emissions addressable 2 with C++ 1 The Shift Project, Lean ICT, March 2019 2 Cisco Annual Internet Report 2020 + HTTP Archive, State of The Web 11.2020 3 W3Techs, server-side programming languages distribution, top 10 Millions websites, 11.2020
  13. 13 tipi.build @ Azure Zürich User Group Carbon footprint Case

    study on a typical web application To serve 43 000 web requests / seconds with common cloud hardware : C++ State of the art (e.g. PHP, Python, TS, Ruby) 1’840 kgCO2e / year 12’880 kgCO2e / year Dell R440 Xeon Gold 1480 kWh Energy Demand / year Dell estimated product carbon footprint & single query TechEmpower Web Framework Benchmark (May 2020)
  14. Why C++ for webapps ? 14 tipi.build @ Azure Zürich

    User Group
  15. Efficiency ! 15 tipi.build @ Azure Zürich User Group

  16. First part of our journey : Microservices vs Monoliths 16

    tipi.build @ Azure Zürich User Group
  17. Microservices vs Monoliths 17 tipi.build @ Azure Zürich User Group

    - Vertical scalability only - Availability issues + Simplicity + Everything in the same memory space Monoliths
  18. Microservices vs Monoliths 18 tipi.build @ Azure Zürich User Group

    - Lot of Marshalling code between services - Shared state data races ~ Prone to Conway’s Law + Horizontal scalability + High Availability + Degraded operation mode Microservices
  19. Monolithization Term coined by Leonid Stryzhevskyi (@lganzzzo) https://oatpp.io/docs/monolithization/ 19 tipi.build

    @ Azure Zürich User Group
  20. Monolithization 20 tipi.build @ Azure Zürich User Group Source :

    oatpp.io
  21. Monolithization 21 tipi.build @ Azure Zürich User Group Source :

    oatpp.io
  22. 22 tipi.build @ Azure Zürich User Group Monoliths Microservices

  23. How is built ? 23 tipi.build @ Azure Zürich User

    Group
  24. 24 tipi.build @ Azure Zürich User Group

  25. 25 tipi.build @ Azure Zürich User Group

  26. 26 tipi.build @ Azure Zürich User Group

  27. How is built ? 27 tipi.build @ Azure Zürich User

    Group
  28. C++ 28 tipi.build @ Azure Zürich User Group Technology Stack

  29. 29 tipi.build @ Azure Zürich User Group helps reusing code.

    Reuse code !
  30. C++ 30 tipi.build @ Azure Zürich User Group Technology stack

    Oat++ Oatpp-starter at https://github.com/tipi-build/oatpp-starter
  31. C++ 31 tipi.build @ Azure Zürich User Group Technology stack

    Oat++ NuxtJS WebAssembly
  32. 32 tipi.build @ Azure Zürich User Group

  33. 33 tipi.build @ Azure Zürich User Group

  34. 34 needs you ! https://tipi.build/ Register & Learn More tipi.build

    @ Azure Zürich User Group We dogfood but…
  35. 35 tipi.build @ Azure Zürich User Group is built with

  36. REST APIs 36 tipi.build @ Azure Zürich User Group

  37. REST : Intro 37 tipi.build @ Azure Zürich User Group

    • Accessing resources using URIs • Resources encapsulate entities • Resources are manipulated • CRUD • through hypertext representations • transferred in messages • Strong decoupling of client and server “anarchic scalability” & “low-entry barrier” REST Representational state transfer
  38. RESTful webservices 38 tipi.build @ Azure Zürich User Group §

    A base URI § HTTP methods e.g. GET, POST, PUT, DELETE § media type that defines state transition data elements e.g. application/json; charset=utf-8 § URI segments to identify resources
  39. 39 tipi.build @ Azure Zürich User Group RESTful webservices

  40. REST Server 40 tipi.build @ Azure Zürich User Group Oat++

    RESTful Webservice Data Transfer Object
  41. OpenAPI REST 41 tipi.build @ Azure Zürich User Group

  42. OpenAPI REST 42 tipi.build @ Azure Zürich User Group Oat++

    OpenAPI Server
  43. To learn more about OpenAPI Clients with C++20 Watch our

    CppCon2021 talk Our Adventures With REST API in C++ : Making it Easy 43 tipi.build @ Azure Zürich User Group
  44. Interfacing with Azure 44 tipi.build @ Azure Zürich User Group

  45. 45 tipi.build @ Azure Zürich User Group Azure DNS

  46. 46 tipi.build @ Azure Zürich User Group

  47. 47 tipi.build @ Azure Zürich User Group Azure DNS

  48. 48 tipi.build @ Azure Zürich User Group

  49. JSON Web Token 49 tipi.build @ Azure Zürich User Group

    JWT: HTTP Bearer Auth
  50. JSON Web Token 50 tipi.build @ Azure Zürich User Group

    Adding support to Oat++
  51. 51 tipi.build @ Azure Zürich User Group Oat++ BearerAuthorizationHandler

  52. 52 tipi.build @ Azure Zürich User Group ORM Object-Relational Mapping

  53. 53 tipi.build @ Azure Zürich User Group ORM Thing that

    maps SQL Tables to Classes
  54. 54 tipi.build @ Azure Zürich User Group NoORM for NoSQL

    We’ll store objects directly
  55. tipi.build machines 55 tipi.build @ Azure Zürich User Group

  56. 56 tipi.build @ Azure Zürich User Group JSON and a

    bit of SQL
  57. 57 tipi.build @ Azure Zürich User Group JSON and a

    bit of SQL
  58. To serialize JSON like the cool kids with C++20 Watch

    our CppCon2021 talk Our Adventures With REST API in C++ : Making it Easy https://github.com/tipi-build/openapipp/ 58 tipi.build @ Azure Zürich User Group
  59. C++20 better [de]serialization 59 tipi.build @ Azure Zürich User Group

  60. JSONB advantages 60 tipi.build @ Azure Zürich User Group §

    Postgres JSONB performance § Faster than mongodb § Same speed as columns § Simplicity § Who needs data migration when you have std::optional ?
  61. 61 tipi.build @ Azure Zürich User Group deploys many manycores

    machines !
  62. tipi.build environments 62 tipi.build @ Azure Zürich User Group

  63. 63 tipi.build @ Azure Zürich User Group linux.pkr.js linux-cxx17.cmake hash

  64. Zombies in tipi.build ! 64 tipi.build @ Azure Zürich User

    Group
  65. Zombies in tipi.build ! 65 tipi.build @ Azure Zürich User

    Group
  66. 66 tipi.build @ Azure Zürich User Group $> tipi build

    . -t macos –j 128
  67. 67 tipi.build @ Azure Zürich User Group $> tipi build

    . -t macos –j 128 addr2line addr2line addr2line addr2line addr2line addr2line addr2line addr2line addr2line
  68. Thanks www.tipi.build Damien Buhl damien@tipi.build +41 (0) 78 984 08

    13