Reactive microservices with play and akkascalaconfjp
This document discusses making microservices reactive using Play and Akka in Scala. It describes how to make a customer microservice resilient to data store failures and elastic to varying workloads. The solution involves clustering the data store using Postgres BDR, deploying the microservices to multiple nodes using ConductR for elastic scaling, and replicating cache updates across nodes using Akka data replication.
Without Resilience, Nothing Else MattersJonas Bonér
It doesn’t matter how beautiful, loosely coupled, scalable, highly concurrent, non-blocking, responsive and performant your application is—if it isn't running, then it's 100% useless. Without resilience, nothing else matters.
Most developers understand what the word resilience means, at least superficially, but way too many lack a deeper understanding of what it really means in the context of the system that they are working on now. I find it really sad to see, since understanding and managing failure is more important today than ever. Outages are incredibly costly—for many definitions of cost—and can sometimes take down whole businesses.
In this talk we will explore the essence of resilience. What does it really mean? What is its mechanics and characterizing traits? How do other sciences and industries manage it, and what can we learn from that? We will see that everything hints at the same conclusion; that failure is inevitable and needs to be embraced, and that resilience is by design.
This document contains the slides from a talk given by Konrad Malawski on the "Tao/Zen of Programming" using Akka. Some of the key points discussed include:
- Actors are meant to work together and each actor should focus on a single responsibility. Having only one actor limits its capabilities.
- Actors should be structured in a hierarchy with parent-child relationships to allow for supervision. Actors should also be named meaningfully based on their purpose.
- Blocking operations can starve other actors by monopolizing shared resources. Blocking code needs to be isolated on dedicated dispatchers.
- Messages should be processed asynchronously using for/flatMap instead of awaiting futures to avoid blocking
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]David Buck
Java SE 8の主要な機能として、Lambda(クロージャ)とデフォルト・メソッド(従来ディフェンダー・メソッドもしくはエクステンション・メソッドと呼ばれていた)があります。クロージャを言語に追加することによってアプリケーションやライブラリに新たな表現の機会が与えられましたが、実際にはどのように実装すべきなのでしょうか。Lambdaはインナー・クラスによってシンプルでかつ文法的にコンパクトになるということは広く理解されていると思います。しかし、現実にはLambdaによる記述は、Invokedynamicを使った実装によって従来のJavaとは異なったものになっています。本セッションでLambdaについて、さらに深く理解してください。
Journey of Migrating Millions of Queries on The Cloudtakezoe
This document discusses challenges in upgrading a query engine and summarizing strategies for efficiently simulating queries to test compatibility and performance. It proposes grouping queries by signature and narrowing data scans to reduce the number of queries tested. It also recommends automating result verification by generating human-readable reports and excluding uncheckable queries. Assistance tools are proposed to aid investigation of differences, which helped discover real bugs in the target version.
GitBucket: Open source self-hosting Git server built by Scalatakezoe
This document provides information about GitBucket, an open source self-hosting Git server created by Naoki Takezoe using Scala. Some key points:
- GitBucket is an open source self-hosting Git server built using Scala and Java technologies. It allows hosting both public and private repositories.
- It has over 8,000 stars on GitHub and supports features like issues, pull requests, wiki pages, and plugins.
- The developer chose Scala for its interoperability with Java libraries and broad ecosystem. This helped minimize development costs, which is important for sustainability of personal open source projects.
Testing Distributed Query Engine as a Servicetakezoe
Naoki Takezoe from Treasure Data discussed testing their distributed query engine Presto as a service. They developed a tool called presto-query-simulator to test using production data and queries in a safe manner. The tool reduces testing time by grouping similar queries and narrowing data scans. It also helps analyze results and find problematic queries. Future work includes running tests more frequently and improving coverage.
This document discusses different approaches to dependency injection in Scala, including Google Guice, implicit parameters, the cake pattern, Reader monad, MacWire, and Airframe. It compares runtime DI approaches like Guice and Airframe to compile-time approaches. The best approach depends on whether auto-wiring is needed, whether compile-time checking or dynamic binding is preferred, and whether life-cycle management is required.
How to keep maintainability of long life Scala applicationstakezoe
Naoki Takezoe discusses maintaining long-term Scala applications. He outlines two main difficulties: programming style differences that impact understandability and upgrades that require coordinating framework, Scala, and Java version changes. Case studies show upgrades can be blocked until dependent libraries support new versions. Solutions include reducing dependencies, using popular libraries, custom libraries for core components, and considering Java alternatives. Regular maintenance and preparing for breaking changes are key to sustainable Scala applications.
GitBucket: Git Centric Software Development Platform by Scalatakezoe
GitBucket is an open source Git server platform written in Scala that provides easy installation and setup. It allows for public and private repositories along with features like issue tracking, pull requests, wikis, and notifications. While based on traditional Java technologies like Jetty and JGit, it uses the Scalatra framework to integrate these components and provide a unified web interface for managing Git repositories and collaboration.
Xtend is a Java-compatible language developed by Eclipse. It has a simpler syntax than Java and compiles to Java bytecode. Xtend supports features like lambda expressions, extension methods, and switch expressions. It has strong tooling support in Eclipse and IntelliJ IDEs. Xtend aims to be a pragmatic alternative to Java for development while maintaining full interoperability.
Zipkin is a distributed tracing system created by Twitter that allows services to record and query traces of requests across microservices. It uses HTTP headers to propagate trace data between services and stores trace data in storage backends like Cassandra, MySQL, or Elasticsearch. The Brave library can be used to instrument Java applications to send trace data to a Zipkin server.
This document discusses using Scala and Scala.js for type-safe front-end web development. It introduces Scala.js, which compiles Scala code to JavaScript, enabling the use of Scala on the front-end. It also discusses related libraries like ScalaTags for type-safe HTML generation and ScalaCSS for type-safe CSS. While Scala.js enables fully type-safe front-ends, the document acknowledges challenges like large JavaScript file sizes and lack of type mappings for existing JavaScript libraries. It proposes an approach where Scala programmers provide Scala.js interfaces for front-end code, while JavaScript programmers implement the user interface using frameworks like React.
This document compares various Scala frameworks for building web applications and interacting with databases. It discusses alternatives to the standard Play and Slick frameworks, including Finagle, Akka HTTP, Skinny Micro, Quill, doobie, and ScalikeJDBC. For web frameworks, all the alternatives look promising but Play is also still viable. For databases, there is no clear standard yet, but ScalikeJDBC appears suitable for most users.
This document discusses macros in Scala. Macros allow code to be generated at compile time by expanding directives or generating abstract syntax trees (ASTs). Examples show how macros can be used for validation, type generation, domain-specific languages (DSLs), and optimization without runtime overhead. The document explains macro types in Scala, how to construct ASTs using AST models, reify, and quasiquotes, and future plans to replace scala.reflect with the safer scala.meta metaprogramming toolkit.
The document discusses Reactive Slick, a new version of the Slick database access library for Scala that provides reactive capabilities. It allows parallel database execution and streaming of large query results using Reactive Streams. Reactive Slick is suitable for composite database tasks, combining async tasks, and processing large datasets through reactive streams.
markedj: The best of markdown processor on JVMtakezoe
This document discusses selecting a markdown parser for a Scala-based GitHub clone called GitBucket. It evaluates several Java-based markdown parsers but finds them lacking support for features like GitHub Flavored Markdown tables and fences. It describes initially trying to port the JavaScript markdown parser marked.js to Scala but facing issues with its use of regular expressions and mutability. The document then explains the decision to port marked.js to Java instead, resulting in the new markdown parser markedj, which supports GFM and has a simple API. GitBucket plans to switch to using markedj starting in its next version.
GitBucket: The perfect Github clone by Scalatakezoe
GitBucket is an open-source GitHub clone written in Scala that provides features like public and private repositories, wiki, issues, pull requests, and more. It uses Scala web frameworks like Scalatra and Twirl for the backend and JVM technologies like JGit, H2 database, and Apache MINA for key functions. GitBucket aims to be easy to install, run purely on the JVM, and provide an alternative for those unable to access GitHub due to political restrictions.
The document discusses frustrations experienced using Scala in a large project that ported a Java web application to Scala, including long compilation times, issues with ScalaIDE and sbt, and limitations of frameworks like Anorm; it then provides solutions the author developed to address these challenges, such as libraries to improve validation, ORM usage, and integration with Play frameworks.