The value proposition of Rust and the demonstrated success of the community led Kraken to begin rewriting core services in Rust mid-2018. A few Kraken engineers started experimenting and saw it as an opportunity to build a lasting system that would match Kraken’s backend needs: performance similar to C++, modern language constructs helping to accurately model business logic and error cases, planned first-class support of asynchronous programming, compile-time thread safety, and a vibrant ecosystem. Its reliability and performance has made it successful in cryptocurrency and blockchain projects. Kotlin provides a more elaborate type system and like Go, it makes asynchronous programming relatively easy, but comes with a Java ecosystem carrying a lot of legacy.Įnter Rust. While Go protects against this specific class of vulnerabilities, it does not provide modern programming features like generics or sum types which ultimately lead to data modelling issues or repetitions. Even the best C++ teams in the world, like those building Windows™ or Chrome™, produce code where about 70% of CVEs are due to memory safety issues ‒such as use after free, buffer overflows, double free, that can lead to privilege escalation or accessing memory‒ that are completely prevented by languages such as Java, Go or Rust. As such, we prefer not to let C++ code run against user input. While Rust promised performance, security and modern language constructs, picking it as the language to rewrite core services was a bet. Why Rust?Įarly 2018, Kraken already had production services written in Go and C++. It was acknowledged early in 2018 that remaining with PHP was not the best long-term solution to achieve these goals. make the system more maintainable and robust even as it grows larger,.Our key goals with a rewrite of core services were to: Strong types provide guarantees (and formal documentation) that enable fast development and more developers to work on a single code base. In this regard, dynamically typed programming languages are great to start building, but it becomes more difficult to maintain code as the code base and number of engineers grow. More generally, Kraken has entered a stage of hypergrowth with which the code base and tools need to keep up. ![]() These core services deal with distributed data storage, cryptography and information security considerations which are less likely to be common skill sets among PHP developers, who are generally more focused on building on existing Web and e-commerce frameworks. However, Kraken has grown dramatically since, and it has become difficult to expand the PHP code base, share the know-how and make larger changes safely. It is impressive to see how much functionality was built in the early days. When Kraken was founded in 2011, PHP offered a mix of execution safety, speed and productivity. While we can make sure to avoid these common pitfalls, it is important to challenge the need for a rewrite in the first place. Other times, the new solution is theoretically better, but takes too much time to be ready, slowing down progress on the system actively serving requests. This is particularly common when the original developers are not part of the design and implementation of the new solution. Often, building a solution from scratch to fix one problem leaves us with another. Finally, this is also a massive thank you to all who helped make Rust possible, and a way for Kraken to contribute positively to this movement. It is our hope that this article will be a helpful resource to companies considering building with Rust and to developers who want to invest the time learning the language. ![]() ![]() There are many great online resources explaining how Rust is different and why it is a great language. I’d like to provide a retrospective of the Core Backend team’s usage of Rust the last two years and share our perspective building with it at scale. Hi □! I’m Simon, the Director of Engineering at Kraken leading the Core Backend team. Simon Chemouil – Director of Engineering, Core Backendįor more than two years now, Kraken’s Core Backend team has been using Rust to modernize services originally written in PHP, while building new products, expanding the feature set and supporting the ever expanding increase in cryptocurrency trading activity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |