Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
Xitrum is an asynchronous and clustered Scala web framework and HTTP server built on top of Netty and Akka. It is feature-rich, easy to use, and high performance. Xitrum can scale to a cluster of servers using Akka Cluster and Hazelcast. It is used in production systems in various countries. The document provides information on Xitrum's architecture, features, annotations, and examples of actions and SockJS messaging.
The document discusses differences between Ruby and Scala programming languages. Some key similarities include both being class-based object-oriented languages with functional features. Differences include Scala using explicit types while Ruby is dynamically typed, and Scala having separate concepts of methods and functions while Ruby blurs the distinction. The document also compares features like class definitions, collections, functions as values, and enhancing existing classes.
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!scalaconfjp
Macros allow code to generate code by replacing expressions during compilation. They enable simplifying code and improving efficiency. While macros are powerful, their implementation can be complex, requiring knowledge of compiler internals. The scala.meta library aims to simplify metaprogramming by representing programs as trees without losing information, making macros easier to write without deep compiler expertise.
- The document discusses how Scala code is compiled to Java Virtual Machine (JVM) bytecodes. It begins with an introduction to Koichi Sakata, the presenter, and an overview that the session will look at JVM bytecodes for beginners.
- The presentation then asks if attendees know what happens when Scala code is compiled. It is explained that Scala code, like code from other JVM languages, is compiled to class files that contain JVM bytecodes.
- An example Java class file is opened in a binary editor to show the JVM bytecode format. It is explained that class files have a defined format with elements like magic number, version, and bytecode instructions.
Scala Matsuri 2016: Japanese Text Mining with Scala and SparkEduardo Gonzalez
This document provides an overview and examples of text mining Japanese documents with Scala and Spark. It discusses preprocessing Japanese text with word segmentation tools like Kuromoji, building topic models with LDA, and generating word embeddings with Word2Vec. Examples are given for segmenting Japanese text, creating document corpora, training LDA models to extract topics, and using Word2Vec to find word similarities. The document emphasizes that high quality word vectors require large datasets.
A presentation at Twitter's official developer conference, Chirp, about why we use the Scala programming language and how we build services in it. Provides a tour of a number of libraries and tools, both developed at Twitter and otherwise.
This document provides an overview of the Scala programming language. Some key points:
- Scala runs on the Java Virtual Machine and was created by Martin Odersky at EPFL.
- It has been around since 2003 and the current stable release is 2.7.7. Release 2.8 beta 1 is due out soon.
- Scala combines object-oriented and functional programming. It has features like pattern matching, actors, XML literals, and more that differ from Java. Everything in Scala is an object.
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
Node.js vs Play Framework (with Japanese subtitles)Yevgeniy Brikman
Video: http://www.nicovideo.jp/watch/1410857293
Here's the showdown you've been waiting for: Node.js vs Play Framework. Both are popular open source web frameworks that are built for developer productivity, asynchronous I/O, and the real time web. But which one is easier to learn, test, deploy, debug, and scale? Should you pick Javascript or Scala? The Google v8 engine or the JVM? NPM or Ivy? Grunt or SBT? Two frameworks enter, one framework leaves.
This version of the presentation has Japanese subtitles. For the English only version, see http://www.slideshare.net/brikis98/nodejs-vs-play-framework
The document provides an overview of Scala and discusses its advantages compared to other programming languages. Some key points:
- Scala is a multi-paradigm language that supports both object-oriented and functional programming. It runs on the JVM and can access Java libraries.
- Functional programming in Scala enables easier concurrency and scalability compared to imperative programming. Static typing also adds type safety.
- Scala provides flexibility to write code in different styles depending on one's skill level, without restricting creativity. Its REPL environment makes it easy to learn interactively.
- While Scala compilation times can be long, its hybrid approach enables gradual learning from both object-oriented and functional perspectives
Java 7 was released in July 2011 with improvements to performance, concurrency, and memory management. Plans for Java 8 include modularity, lambda expressions, and date/time APIs. The Java Community Process is also being improved to increase transparency, participation, and agility through JSR 348. Overall, the Java ecosystem continues to grow with new languages on the JVM and an active community.
This document discusses using Akka and actors for building scalable and concurrent applications in Scala. It introduces actors as fundamental units of computation that communicate asynchronously via message passing. Akka provides tools for creating actor systems and hierarchies. The document uses a monitoring application called Scotchdog as an example, with actors to represent services that are monitored by a watchdog actor. It describes how messages are used to start, stop and check services, and how the watchdog can aggregate status from child actors. The document also briefly mentions using Akka's scheduler and finite state machines to implement more complex actor behaviors.
This document discusses extending Oracle E-Business Suite using Ruby on Rails. It provides an overview of how to extend EBS functionality by embedding EBS data in other systems or customizing forms and reports. It then discusses the evolution of EBS extension approaches over time from custom PL/SQL to various Java-based frameworks. It introduces Ruby on Rails as an alternative approach, describing how Rails uses an MVC architecture and Active Record pattern. It demonstrates how to connect Rails to Oracle databases using enhanced Oracle adapters and call PL/SQL from Ruby. Finally, it discusses deployment options and provides references for more information.
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)Stephen Chin
JavaFX 2.0 is the next version of a revolutionary rich client platform for developing immersive desktop applications. One of the new features in JavaFX 2.0 is a set of pure Java APIs that can be used from any JVM language, opening up tremendous possibilities. This presentation demonstrates the benefits of using JavaFX 2.0 together with the Scala programming language to provide a type-safe declarative syntax with support for lazy bindings and collections. Advanced language features, such as DelayedInit and @specialized will be discussed, as will ways of forcing prioritization of implicit conversions for n-level cases. Those who survive the pure technical geekiness of this talk will be rewarded with plenty of JavaFX UI eye candy.
Akka and the Zen of Reactive System DesignLightbend
In order to be successful with asynchronous programming, when coming from synchronous execution models you need to change your mindset and look at things from a slightly different perspective. In order to use Akka at it's best, you will have to change the way you think about application design (loosen coupling in space and time between components), and re-think what you've maybe learned in the past.
In this talk we uncover a number of rules that serve as a guide in designing concurrent distributed applications, how those apply to Akka, and how they can help you in daily app development.
Aimed at developers through architects, Akka team happy hAkker, Konrad Malawski, bends your parameters with regards to application design and asynchronous execution models.
This document provides an overview of Scala-ActiveRecord, a type-safe Active Record model library for Scala. It discusses features such as being type-safe, having Rails ActiveRecord-like functionality, automatic transaction control, and support for associations and validations. The document also covers getting started, defining schemas, CRUD operations, queries, caching queries, validations, callbacks, and relationships.
Building Concurrent WebObjects applications with ScalaWO Community
This document discusses using Scala for concurrent programming in WebObjects applications. It begins by explaining why concurrent programming is important due to increasing numbers of processor cores. It then discusses challenges with traditional threading and locks and introduces the actor model as an easier and more scalable approach using message passing. The document demonstrates how to build concurrent WebObjects applications using Scala actors for processing tasks like video encoding. It shows how properties can configure WebObjects for concurrent requests and how ERXEC provides thread safety. Benchmarks show the Scala actor approach outperforms traditional threading. The document argues that Scala is a powerful, safe and easy language for concurrent programming in WebObjects.
This document provides an introduction to JVM bytecode, including how to inspect, generate, and understand bytecode. It discusses two main parts - JVM bytecode itself such as basic instructions and stack operations, and the JVM JIT compiler which compiles bytecode to machine code. Various tools for working with bytecode like javap and ASM are also introduced. The document is intended to help readers gain a better understanding of how the Java platform works from the lowest level.
Fast Web Applications Development with Ruby on Rails on OracleRaimonds Simanovskis
This document provides an overview of Ruby on Rails and how it can be used to develop fast web applications with an Oracle database backend. It discusses key Rails concepts like MVC architecture and Active Record. It also demonstrates how to connect Rails to Oracle using gems like ruby-oci8, activerecord-oracle_enhanced-adapter, and ruby-plsql to access Oracle data types, stored procedures, and full-text search capabilities. The document concludes with deployment options and pointers to related sessions.
This document summarizes how to use Ruby on Rails with legacy Oracle databases. It discusses using the ruby-oci8 and jruby-oci8 gems to connect to Oracle from Ruby. It also covers using the activerecord-oracle_enhanced-adapter gem to connect to Oracle from Rails. It provides examples of calling PL/SQL functions from Ruby using the ruby-plsql gem and overriding ActiveRecord methods to call custom PL/SQL packages. Finally, it diagrams a typical Rails application architecture when using an Oracle database.
This document provides an overview of search and indexing in Adobe Experience Manager using Apache Oak. It discusses Oak query implementation, cost calculation, and various index implementations like property, ordered, Lucene, Solr, and traversing indexes. It provides details on how indexes are defined, when to reindex, debugging cost calculation, and troubleshooting Solr. The primary messages are that search is significantly different between CRX2 and Oak, Oak provides more optimization opportunities but requires more configuration, and indexes need to be understood to optimize query performance.
The document discusses bytecode and the Java Virtual Machine (JVM). It provides an example of decompiling the "Hello World" Java program using javap to view the bytecode instructions. It also covers bytecode fundamentals like the stack machine model, instruction types, and how the operand stack and frames work. Finally, it demonstrates some common stack manipulation instructions.
A short introduction (with many examples) to the Scala programming language and also an introduction to using the Play! Framework for modern, safe, efffcient and reactive web applications.
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.
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介scalaconfjp
SparkSQL is a Spark component that allows SQL queries to be executed on Spark. It uses Catalyst, which provides an execution planning framework for relational operations like SQL parsing, logical optimization, and physical planning. Catalyst defines logical and physical operators, expressions, data types and provides rule-based optimizations to transform query plans. The SQL core in SparkSQL builds SchemaRDDs to represent queries and allows reading/writing to Parquet and JSON formats.
This document provides an overview of the Scala programming language. Some key points:
- Scala runs on the Java Virtual Machine and was created by Martin Odersky at EPFL.
- It has been around since 2003 and the current stable release is 2.7.7. Release 2.8 beta 1 is due out soon.
- Scala combines object-oriented and functional programming. It has features like pattern matching, actors, XML literals, and more that differ from Java. Everything in Scala is an object.
Presented at BJUG, 6/12/2012 by Roger Brinkley
This talk is on 55 new features in Java 7 you (probably) didn't hear about in an ignite format of one per minute. No stopping, no going back....Questions, sure but only if time remains (otherwise save for later).
Node.js vs Play Framework (with Japanese subtitles)Yevgeniy Brikman
Video: http://www.nicovideo.jp/watch/1410857293
Here's the showdown you've been waiting for: Node.js vs Play Framework. Both are popular open source web frameworks that are built for developer productivity, asynchronous I/O, and the real time web. But which one is easier to learn, test, deploy, debug, and scale? Should you pick Javascript or Scala? The Google v8 engine or the JVM? NPM or Ivy? Grunt or SBT? Two frameworks enter, one framework leaves.
This version of the presentation has Japanese subtitles. For the English only version, see http://www.slideshare.net/brikis98/nodejs-vs-play-framework
The document provides an overview of Scala and discusses its advantages compared to other programming languages. Some key points:
- Scala is a multi-paradigm language that supports both object-oriented and functional programming. It runs on the JVM and can access Java libraries.
- Functional programming in Scala enables easier concurrency and scalability compared to imperative programming. Static typing also adds type safety.
- Scala provides flexibility to write code in different styles depending on one's skill level, without restricting creativity. Its REPL environment makes it easy to learn interactively.
- While Scala compilation times can be long, its hybrid approach enables gradual learning from both object-oriented and functional perspectives
Java 7 was released in July 2011 with improvements to performance, concurrency, and memory management. Plans for Java 8 include modularity, lambda expressions, and date/time APIs. The Java Community Process is also being improved to increase transparency, participation, and agility through JSR 348. Overall, the Java ecosystem continues to grow with new languages on the JVM and an active community.
This document discusses using Akka and actors for building scalable and concurrent applications in Scala. It introduces actors as fundamental units of computation that communicate asynchronously via message passing. Akka provides tools for creating actor systems and hierarchies. The document uses a monitoring application called Scotchdog as an example, with actors to represent services that are monitored by a watchdog actor. It describes how messages are used to start, stop and check services, and how the watchdog can aggregate status from child actors. The document also briefly mentions using Akka's scheduler and finite state machines to implement more complex actor behaviors.
This document discusses extending Oracle E-Business Suite using Ruby on Rails. It provides an overview of how to extend EBS functionality by embedding EBS data in other systems or customizing forms and reports. It then discusses the evolution of EBS extension approaches over time from custom PL/SQL to various Java-based frameworks. It introduces Ruby on Rails as an alternative approach, describing how Rails uses an MVC architecture and Active Record pattern. It demonstrates how to connect Rails to Oracle databases using enhanced Oracle adapters and call PL/SQL from Ruby. Finally, it discusses deployment options and provides references for more information.
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)Stephen Chin
JavaFX 2.0 is the next version of a revolutionary rich client platform for developing immersive desktop applications. One of the new features in JavaFX 2.0 is a set of pure Java APIs that can be used from any JVM language, opening up tremendous possibilities. This presentation demonstrates the benefits of using JavaFX 2.0 together with the Scala programming language to provide a type-safe declarative syntax with support for lazy bindings and collections. Advanced language features, such as DelayedInit and @specialized will be discussed, as will ways of forcing prioritization of implicit conversions for n-level cases. Those who survive the pure technical geekiness of this talk will be rewarded with plenty of JavaFX UI eye candy.
Akka and the Zen of Reactive System DesignLightbend
In order to be successful with asynchronous programming, when coming from synchronous execution models you need to change your mindset and look at things from a slightly different perspective. In order to use Akka at it's best, you will have to change the way you think about application design (loosen coupling in space and time between components), and re-think what you've maybe learned in the past.
In this talk we uncover a number of rules that serve as a guide in designing concurrent distributed applications, how those apply to Akka, and how they can help you in daily app development.
Aimed at developers through architects, Akka team happy hAkker, Konrad Malawski, bends your parameters with regards to application design and asynchronous execution models.
This document provides an overview of Scala-ActiveRecord, a type-safe Active Record model library for Scala. It discusses features such as being type-safe, having Rails ActiveRecord-like functionality, automatic transaction control, and support for associations and validations. The document also covers getting started, defining schemas, CRUD operations, queries, caching queries, validations, callbacks, and relationships.
Building Concurrent WebObjects applications with ScalaWO Community
This document discusses using Scala for concurrent programming in WebObjects applications. It begins by explaining why concurrent programming is important due to increasing numbers of processor cores. It then discusses challenges with traditional threading and locks and introduces the actor model as an easier and more scalable approach using message passing. The document demonstrates how to build concurrent WebObjects applications using Scala actors for processing tasks like video encoding. It shows how properties can configure WebObjects for concurrent requests and how ERXEC provides thread safety. Benchmarks show the Scala actor approach outperforms traditional threading. The document argues that Scala is a powerful, safe and easy language for concurrent programming in WebObjects.
This document provides an introduction to JVM bytecode, including how to inspect, generate, and understand bytecode. It discusses two main parts - JVM bytecode itself such as basic instructions and stack operations, and the JVM JIT compiler which compiles bytecode to machine code. Various tools for working with bytecode like javap and ASM are also introduced. The document is intended to help readers gain a better understanding of how the Java platform works from the lowest level.
Fast Web Applications Development with Ruby on Rails on OracleRaimonds Simanovskis
This document provides an overview of Ruby on Rails and how it can be used to develop fast web applications with an Oracle database backend. It discusses key Rails concepts like MVC architecture and Active Record. It also demonstrates how to connect Rails to Oracle using gems like ruby-oci8, activerecord-oracle_enhanced-adapter, and ruby-plsql to access Oracle data types, stored procedures, and full-text search capabilities. The document concludes with deployment options and pointers to related sessions.
This document summarizes how to use Ruby on Rails with legacy Oracle databases. It discusses using the ruby-oci8 and jruby-oci8 gems to connect to Oracle from Ruby. It also covers using the activerecord-oracle_enhanced-adapter gem to connect to Oracle from Rails. It provides examples of calling PL/SQL functions from Ruby using the ruby-plsql gem and overriding ActiveRecord methods to call custom PL/SQL packages. Finally, it diagrams a typical Rails application architecture when using an Oracle database.
This document provides an overview of search and indexing in Adobe Experience Manager using Apache Oak. It discusses Oak query implementation, cost calculation, and various index implementations like property, ordered, Lucene, Solr, and traversing indexes. It provides details on how indexes are defined, when to reindex, debugging cost calculation, and troubleshooting Solr. The primary messages are that search is significantly different between CRX2 and Oak, Oak provides more optimization opportunities but requires more configuration, and indexes need to be understood to optimize query performance.
The document discusses bytecode and the Java Virtual Machine (JVM). It provides an example of decompiling the "Hello World" Java program using javap to view the bytecode instructions. It also covers bytecode fundamentals like the stack machine model, instruction types, and how the operand stack and frames work. Finally, it demonstrates some common stack manipulation instructions.
A short introduction (with many examples) to the Scala programming language and also an introduction to using the Play! Framework for modern, safe, efffcient and reactive web applications.
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.
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介scalaconfjp
SparkSQL is a Spark component that allows SQL queries to be executed on Spark. It uses Catalyst, which provides an execution planning framework for relational operations like SQL parsing, logical optimization, and physical planning. Catalyst defines logical and physical operators, expressions, data types and provides rule-based optimizations to transform query plans. The SQL core in SparkSQL builds SchemaRDDs to represent queries and allows reading/writing to Parquet and JSON formats.
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...scalaconfjp
This document discusses Scarab, a SAT-based constraint programming system developed in Scala. Scarab provides a domain-specific language and APIs for modeling constraint satisfaction problems and solving them using SAT encodings and SAT solvers like Sat4j. It aims to provide an expressive, efficient and customizable workbench for developing SAT-based systems. The document gives examples of using Scarab to model and solve the graph coloring problem and pandiagonal Latin square problem. It also discusses Scarab's features like efficiency, portability and ability to leverage advanced SAT solving techniques.
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoTaro L. Saito
Silk is a framework for building dataflows in Scala. In Silk users write data processing code with collection operators (e.g., map, filter, reduce, join, etc.). Silk uses Scala Macros to construct a DAG of dataflows, nodes of which are annotated with variable names in the program. By using these variable names as markers in the DAG, Silk can support interruption and resume of dataflows and querying the intermediate data. By separating dataflow descriptions from its computation, Silk enables us to switch executors, called weavers, for in-memory or cluster computing without modifying the code. In this talk, we will show how Silk helps you run data-processing pipelines as you write the code.
Vector and ListBuffer have similar performance for random reads. Benchmarking showed no significant difference in throughput, average time, or sample times between reading randomly from a Vector versus a ListBuffer. Vectors are generally faster than Lists for random access due to Vectors being implemented as arrays under the hood.
Scala - The Simple Parts, SFScala presentationMartin Odersky
These are the slides of the talk I gave on May 22, 2014 to the San Francisco Scala user group. Similar talks were given before at GOTO Chicago, keynote, at Gilt Groupe and Hunter College in New York, at JAX Mainz and at FlatMap Oslo.
Beginning Scala with Skinny Framework #jjug_cccKazuhiro Sera
This document provides an overview of the Skinny Framework for building Scala web applications. It discusses how to get started with a basic Skinny application, the MVC structure used in Skinny, database modeling and access using Skinny ORM, and other features like validation, routing and scaffolding. Key points covered include bootstrapping a Skinny app, writing basic controllers and views, defining models and relationships, and generating CRUD pages automatically with scaffolding.
Scala is an object-functional language that runs on the JVM. It supports both object-oriented and functional programming paradigms. Some key features include immutable data structures, pattern matching, strong static typing with type inference, and concurrency through immutable shared state. Popular Scala libraries include Slick for database access, Akka for actors, and Play as a web framework. Scala also enables internal and external domain-specific languages through features like implicits.
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_techKazuhiro Sera
This document introduces ScalikeJDBC, a type-safe SQL library for Scala that provides a non-blocking approach to database access. It summarizes ScalikeJDBC's features, including its DSL for writing queries, SQL interpolation support, and an asynchronous version called ScalikeJDBC-Async. It also briefly introduces a new Scala web framework called Skinny that is inspired by Ruby on Rails and uses ScalikeJDBC.
Spring Day | Spring and Scala | Eberhard WolffJAX London
2011-10-31 | 09:45 AM - 10:30 AM
Spring is widely used in the Java world - but does it make any sense to combine it with Scala? This talk gives an answer and shows how and why Spring is useful in the Scala world. All areas of Spring such as Dependency Injection, Aspect-Oriented Programming and the Portable Service Abstraction as well as Spring MVC are covered.
Using JPA applications in the era of NoSQL: Introducing Hibernate OGMPT.JUG
Sanne Grinovero presented on Hibernate Object/Grid Mapper (OGM), which provides an object-oriented interface for NoSQL databases using JPA. OGM stores entities as serialized tuples and uses Lucene/Hibernate Search for querying. It reuses Hibernate Core and is targeted at Infinispan but also works with other NoSQL databases. The goals are to encourage new data usage patterns with a familiar programming model and ease of use while pushing NoSQL exploration in enterprises.
Increase your performance and code qualityDusko Vesin
This document discusses increasing developer performance and code quality through automation and model-driven development approaches. It introduces the drytools scaffolding tool, which uses a domain-specific language to generate multi-module projects from conceptual models. The DSL allows defining models, APIs, middleware, clients and more to produce fully functioning applications. drytools aims to avoid repetitive work and encourage best practices. While powerful, model-driven approaches also have challenges to balance and maintain over time.
This document discusses drytools, a code generation tool that aims to reduce repetitive work. Some key points:
- Drytools uses a domain-specific language (DSL) to define project structure and generate code for models, APIs, clients, and more based on these definitions.
- The DSL allows defining models with properties, queries, and relationships. APIs can then expose CRUD and custom endpoints for these models.
- Drytools generates common middleware like security and sign in functionality based on annotations in the DSL.
- It produces a full-stack application including a web client, mobile clients, and API mocking for development.
- Benefits include increased speed, enforcing best practices, and
In this talk we present the term polyglot persistence, give a brief introduction to the world of NoSQL database and point out the benefits and costs of polyglot persistence. Thereafter we present the idea of a multi-model database that reduces the costs for polyglot persistence but keeps its benefits. Next up we present ArangoDB as a Multi-Model database
The document discusses various aspects of working with forms in the Lift web framework. It covers topics like standard and AJAX form support, form elements like text boxes, checkboxes and file uploads, using site maps to organize pages, and the mapper and record frameworks for making objects persistent in a database.
As the de facto standard for large-scale data processing in the Java world, Apache Spark is the logical choice when you want to investigate big data processing. As a matter of fact, most resources online refer to the Scala API that is exposed by Spark. What to do if you and your company are much more comfortable with Java than the Scala language? These slides give pointers whether it makes sense to learn and introduce an entirely new language just for your big data processing.
Complex queries in a distributed multi-model databaseMax Neunhöffer
A multi-model database is a document store, a graph database as well as a key/value store. To allow for convenient and powerful querying such a database needs a query language that understands all three data models and allows to mix these models in queries. For example, it should be possible to find some documents in a collection according to some criteria, then follow some edges in a graph in which the documents represent vertices, and finally join the results with documents from yet another collection.
In this talk I will explain how a query engine for such a language works, give an overview of the life of a query from parsing, over translation into an execution plan, the optimisation phase and finally the execution. I will show how distributed query execution plans look like, how the query optimiser reasons about them and how the distributed execution works.
Luis Majano discusses ORM and his CBORM module. He argues that ORM is not a silver bullet and presents 10 keys to ORM success: 1) OO modeling is key; 2) avoid bad engine defaults; 3) understand the Hibernate session; 4) use transaction demarcation; 5) use laziness; 6) avoid bi-directional relationships; 7) do not store entities in scopes; 8) use database indexes; 9) cache for performance boosts; and 10) use HQL maps. CBORM provides base ORM services, virtual ORM services, active entities, entity populators, validation, and event handlers to improve on ORM.
Aeneas:: An Extensible NoSql Enhancing Application SystemCesare Cugnasco
Non-relational databases arise as a solution to solve the scalability problems of relational databases when dealing with big data applications. However, they are highly configurable prone to user decisions that can heavily affect their performance. In
order to maximize the performance, different data models and queries should be analyzed to choose the best fit. This may involve a wide range of tests and may result in productivity issues.
We present Aeneas, a tool to support the design of data management code for applications using non-relational databases. Aeneas provides an easy and fast methodology to support the decision about how to organize and retrieve data in order to improve the performance.
This document provides an introduction to functional programming concepts and the Scala programming language. It begins with a brief history of object-oriented programming and why it became popular. It then discusses why functional programming has gained popularity in recent years due to its ability to handle parallel, reactive and distributed systems through immutable data and avoidance of mutable state. The document introduces functional programming concepts like immutable data, first-class functions and purity. It provides an example of functional-style programming in Scala. Finally, it outlines topics that will be covered about practical functional programming in Scala, including collections, functions, pattern matching and lazy evaluation.
This document discusses why and how Visibiz is using MongoDB in their social CRM application. They chose MongoDB because its schema-free and document-oriented model fits their need to allow customers to extend objects like people and companies with custom attributes. MongoDB also enables scalability through replication and sharding. Visibiz stores data in MongoDB collections like "things" for core and custom objects and "rels" for relationships between objects. They validate data against JSON schemas before storage.
This document introduces Scala ActiveRecord, an ORM library for Scala that aims to provide an ActiveRecord-like experience. It summarizes the motivations for creating Scala ActiveRecord, which were to have a more usable database library that supports type-safety, conventions over configuration, and avoids repetition. It describes key features of Scala ActiveRecord like validations, associations, and callbacks. It also provides examples of basic CRUD operations and queries using Scala ActiveRecord's interface.
1. The document outlines the evolution of graph schemas from early semantic web schemas like RDFS and OWL to simpler property graph schemas.
2. It discusses elements of graph schemas including entity types, relationship types, indexes, and schema imports.
3. Graph and schema management techniques are covered including schema validation, initialization, migration, and revision control.
4. Graph generation techniques are presented for capacity planning and benchmarking graphs of different sizes based on schema statistics.
Intravert Server side processing for CassandraEdward Capriolo
The document provides examples of using CQL (Cassandra Query Language) to create and query tables in Cassandra. It shows how to create tables to store user and video data, insert sample records, and perform queries. It then discusses using the IntraVert library to execute more complex queries directly against Cassandra, such as joins, filters, and multi-table operations, in order to reduce network traffic and processing compared to doing everything on the client side.
NYC* 2013 - "Advanced Data Processing: Beyond Queries and Slices"DataStax Academy
The ColumnFamily data model and wide-row support provides the ability to store and access data efficiently in a de-normalized state. Recent enhancements for CQL's spare tables and built-in indexing provide the capability to store data in a manner similar to that of relational databases. For many use cases hybrid approaches are needed, because complete de-normalization is appropriate for some access patterns whereas more structured data is appropriate for others. At times a single logical event becomes multiple insertions across multiple column families. Likewise a user request might require a several reads across different column families. This talk describes some of these scenarios and demonstrates how advanced operations such multiple step procedures, filtering, intersection, and paging can be implemented client side or server side with the help of the IntraVert plugin.
All I learned while working on a Scala OSS project for over six years #ScalaM...Kazuhiro Sera
* http://2018.scalamatsuri.org/index_en.html
* https://www.youtube.com/watch?v=y7BxvT-Jm6w
In 2011, I started a Scala open source project named ScalikeJDBC. Thanks to many contributors, I am still working on the project after six years. In the meantime, the Scala community has been growing sharply, and the trends have been continuously changing. Despite the fact that the number of developers who work on OSS projects has increased, there are not many developers who have been working on a Scala project for several years. In this talk, I will share my experiences and pieces of knowledge through maintaining the OSS project for more than six years.
Skinny 2 was recently released on November 19th. The update includes moving from Scalatra to Skinny Micro for the servlet layer. Upgrading to Skinny 2 is easy and provides improvements like making async controllers safer when using Scala Futures. The documentation website was also renewed with archived 1.x docs.
This document discusses using Futures in Servlet applications. It notes that while Futures are standard in Scala, directly accessing mutable Servlet API objects like the request from Future threads can cause issues. It describes problems like request objects being recycled before Futures complete. It also discusses how Scalatra's use of DynamicScope for the request/response can cause problems when used with Futures. The document outlines improvements in Skinny Framework that avoid these issues, such as passing a stable Context object and avoiding DynamicScope.
Skinny is a lightweight web framework for Scala that aims to provide a Rails-like development experience. It offers features like routing, CRUD templates, validation, ORM, database migrations, asset compilation, and mail sending. Some benefits highlighted include an easy setup process, statically typed but simple code, and suitability for replacing legacy systems. The framework is under active development with a 1.0 release planned for this week and continued work on future versions.
Skinny Framework is a Scala web framework similar to Rails that aims for apps and frameworks to be "skinny" or lightweight. Version 0.9.17 added features like scaffold generation and database migrations. Version 1.0.0 is planned for Q4 2013 and will focus on fixing issues and establishing stable APIs before continuing development of new features. Contributors are welcome and the framework can be easily tested by running the included blank app template.
This document is a tutorial for the ScalikeJDBC library. It introduces ScalikeJDBC as a tidy SQL-based database access library for Scala developers. It covers key topics like the connection pool, implicit sessions, SQL syntax, the query DSL, testing support, and integration with Play. The tutorial aims to help beginners get started with ScalikeJDBC's main features.
1. Solid and Sustainable
Development in Scala
Kazuhiro Sera @seratch
ScalikeJDBC / Skinny Framework
Founder & Lead Developer
2. Ask Me Later!
• 3 mags for questioners at the end of this
session! Don’t miss it!
2
3. Who Am I
• Kazuhiro Sera • @seratch on Twitter/GitHub • Scala enthusiast since 2010 • ScalikeJDBC, Skinny Framework, AWScala
founder & project lead • A web developer at M3, Inc (We’re a Gold
Sponsor)
5. ScalikeJDBC
• scalikejdbc.org • “Scala-like JDBC” • Provides Scala-ish APIs • Started as a better querulous / Anorm • “Just write SQL and get things done” • QueryDSL for smoothness & type-safety • Stable enough: lots of companies already
use it in production
7. Basic Usage
import scalikejdbc._!
!
ConnectionPool.singleton(!
“jdbc:h2:mem:matsuri”, !
“user”, “secret”)!
SQL statement!
(PreparedStatement)
!
DB autoCommit { implicit session =>!
Side effect !
with DB connection
sql”create table attendee (name varchar(32))”.execute.apply()!
val name = “seratch”!
sql”insert into attendee (name) values ($name)”.update.apply()!
}!
!
val names: Seq[String] = DB readOnly { implicit s =>!
sql”select name from attendee”!
.map(_.string(“name”)).list.apply()!
}
execute/update!
(JDBC operation)
Extractor
8. QueryDSL
import scalikejdbc._!
case class Attendee(name: String)!
object Attendee extends SQLSyntaxSupport[Attendee] {!
def apply(rs: WrappedResultSet, a: ResultName[Attendee]) = !
new Attendee(rs.get(a.name))
}!
!
implicit val session = AutoSession!
!
!
val a = Attendee.syntax(“a”)!
val seratch: Option[Attendee] = withSQL {!
QueryDSL!
(Mostly SQL)
Actual SQL Query
select.from(Attendee as a).where.eq(a.name, “seratch”)!
}.map(rs => new Attendee(rs, a)).single.apply()!
!
// select a.name as n_on_a from attendee a where a.name = ?
9. Skinny Framework
• skinny-framework.org • “Scala on Rails” • For Rails / Play1 lovers • 1.0.0 was out on 28th March • Already several experiences in production • Full-stack features: Web infrastructure,
Scaffold generator, ORM, DB migration,
JSON stuff, HTTP client, Mail sender, Job
workers, Assets controller, etc..
10. Boot in 2 minutes
!
// install skinny command!
brew tap skinny-framework/alt!
brew install skinny!
!
// create app and start!
skinny new myapp!
cd myapp!
skinny run!
!
// access localhost:8080 from your browser!
11. Model (DAO)
import skinny.orm._!
Entity
import scalikejdbc._!
!
case class User(id: Long, name: Option[String])!
!
// companion: data mapper!
object User extends SkinnyCRUDMapper[User] {!
def defaultAlias = createAlias(“u”)!
def extract(rs: WrappedResultSet, u: ResultName[User])!
= autoConstruct(rs, u)
}!
CRUD Mapper Object!
!
(No need to be companion)
User.findById(123)!
User.count()!
User.createWithAttributes(‘name -> “Alice”)!
User.updateById(123).withAttributes(‘name -> “Bob”)!
User.deleteBy(sqls.eq(u.name, “Bob”))
Smooth APIs
12. Controller + Route
package controller!
class UsersController extends ApplicationController {!
def showUsers = {!
set(“users”, User.findAll())!
render(“/users/index”)
}
}!
!
// Routings!
object Controllers {!
Set value in request scope!
(Visible in views)
Expects “src/main/webapp/!
WEB-INF/views/users/index.html.ssp”
val users = new UsersController with Routes {!
get(“/users/”)(showUsers).as(‘showUsers)
}!
def mount(ctx: ServletContext): Unit = {!
users.mount(ctx)!
}
}
14. Web Development
• Interactive feedback loop is most
important especially when changing UI • Actually Scala compilation is so slow that
waiting view templates compilation makes
developers much stressed • Skinny doesn’t compile all the view
templates when developing (unlike Twirl)
16. My Good Parts
•Simplified Class-based OOP And
Immutable Data Structure
•Working On Problems Without
Overkill Abstraction
•Writing Tests Without Question
•Keep Infrastructure Lightweight
•No Surprises For Newcomer
18. Class-based OOP
• Already so popular (Java, Ruby, Python ..) • Old style is friendly with mutability (e.g.
setters, bang methods), but that’s not a
prerequisite • OOP can be more solid and safer by
keeping immutability and avoiding
inheritance anti-patterns
19. Scala or Java 8?
• Scala case class is simpler than Java
beans with (great) Lombok • Scala high-order functions are simpler
than Java 8 Stream API • Immutability is well-treated in Scala • Fairness: Java decisively beats Scala in
comparison with compilation speed..
20. Immutability
• Do away with mutable states • Re-assignment? No way! Don’t use `var` • Immutability makes your apps not only
scalable but also more solid • When you modify a case class, call
#copy() and return new state instead of
using setters for mutability inside
21. Immutable Entity
// entity with behaviors!
case class User(id: Long, name: Option[String])!
extends SkinnyRecord[User] {!
override def skinnyCRUDMapper = User
}!
// data mapper!
object User extends SkinnyCRUDMapper[User] {!
override def defaultAlias = createAlias(“u”)!
override def extract(rs: WrappedResultSet, u: ResultName[User])!
= autoConstruct(rs, u)
}!
!
val noNames: Seq[User] = User.where(‘name -> “”).apply()!
val anons: Seq[User] = noNames.map { user => !
user.copy(name = “Anonymous”).save()!
}
Both of “noNames” and
“anons” are immutable
22. Trait Chaos
• Mixing traits can show you terrible chaos • We should have self-discipline • Prefer `override` modifier to detect API
changes when mixing many traits • Collect the same sort of traits and place
them in same place to avoid code
duplication or unwanted complexity
23. Web Controller
package controller!
class MainController extends ApplicationController !
with concern.TimeLogging {!
def index = logElapsedTime { render(“/main/index”) }!
}!
!
// for controllers!
package controller.concern!
trait TimeLogging { self: SkinnyController with Logging =>!
The “concern” just follows Rails style.
Anyway, naming should be simple and!
easy-to-understand for anyone
def millis: Long = System.currentTimeMillis !
def logElapsedTime[A](action: => A): A = {!
val before = millis!
val result = action!
logger.debug(“Elapsed time: ${millis - before} millis”)!
result
}!
}
24. Coding Style Tips
• Use sbt-scalariform without question
(similar: go-lang’s fmt) • Don’t toss similar classes or traits into
single scala file except `sealed` pattern • Don’t place classes under different
package directory (although it’s possible) • Do you really need cake pattern? • Prefer eloquent method signature than
explaining a lot in scaladocs
26. The Real As-Is
• Abstraction often improves things, but
that’s not always the best way to solve
real-world problems • I/O issue is a typical case that we should
comprehend problems as-is • Database access / SQL is not a collection
but just an external I/O operation • Overkill abstraction makes your code
difficult to maintain for other developers
27. Don’t Hide the SQL
• “You don’t need another DSL to access
relational databases” - Anorm • You must recognize what is working
effectively in the SQL layer • Utility to write DAO easily is fine but
hiding SQL is not good • Need to grab the cause from raw queries
when dealing with troubles (comfortable
logging also can help)
28. SQL Ops As-Is
// A programmer belongs to a company and has several skills!
!
implicit val session = AutoSession!
!
val p: Option[Programmer] = withSQL {!
I believe everybody can
understand this code
select.from(Programmer as p)!
.leftJoin(Company as c).on(p.companyId, c.id)!
.leftJoin(ProgrammerSkill as ps).on(ps.programmerId, p.id)!
.leftJoin(Skill as s).on(ps.skillId, s.id)!
.where.eq(p.id, 123).and.isNull(p.deletedAt)!
}!
.one(rs => Programmer(rs, p, c))!
Extracts one-to-many
.toMany(rs => Skill.opt(rs, s))!
relationships here
.map { (programmer, skills) => programmer.copy(skills = skills) }!
.single!
.apply()
29. Skinny ORM
• ORM built on ScalikeJDBC • Highly inspired by Rails ActiveRecord • SQL queries for CRUD apps are common
enough, so it’s reasonable to avoid writing
mostly same code everywhere • Skinny ORM doesn't prevent you from
using ScaikeJDBC APIs directly • A part of Skinny Framework but you can
use it in Play apps too
31. Mappers
// entities!
case class Company(id: Long, name: String)!
case class Employee(id: Long, name: String,!
companyId: Long, company: Option[Company])!
!
// mappers!
object Company extends SkinnyCRUDMapper[Company] {!
def extract(rs: WrappedResultSet, rn: ResultName[Company]) =!
autoConstruct(rs, rn)
}!
object Employee extends SkinnyCRUDMapper[Employee] {!
def extract(rs: WrappedResultSet, rn: ResultName[Employee]) =!
autoConstruct(rs, rn, “company”)!
// simple association definition!
lazy val companyRef = belongsTo[Company](!
Company, (e, c) => e.copy(company = c))
}
32. Reasonable?
Right, these CRUD operations are not SQL-ish. However, I believe
they’re reasonable because these patterns are already common enough.
!
!
val companyId = Company.createWithAttributes(‘name -> “Sun”)!
val empId = Employee.createWithAttributes(!
‘name -> “Alice”, ‘companyId -> companyId)!
!
val emp: Option[Employee] = Employee.findById(empId)!
val empWithCompany: Option[Employee] = !
Employee.joins(companyRef).findById(123)!
!
Company.updateById(companyId).withAttributes(‘name -> “Oracle”)!
!
val e = Employee.defaultAlias!
Employee.deleteBy(sqls.eq(e.id, empId))!
Using ScalikeJBDC API!
Company.deleteById(companyId)
is also possible
34. Not Only Compiler
• It’s true that compiler helps you by
detecting mistakes in coding • Writing tests is a reasonable way to verify
your code meets requirements /
specifications as expected • You can’t skip automated tests even if
your apps are written in Scala
35. scoverage
• At this time, the only option available for
us is scoverage (SCCT inheritor) • Add the dependency into your projects
right now if you don’t use it yet
37. Avoid SBT Hacks
• sbt is not so easy for Scala newbies,
upgrading sbt is all the more so • Play depends on sbt version (e.g. Play 2.1
w/ sbt 0.12), upgrading Play is about not
only Play API changes but sbt things • Your own sbt plugins/hacks make your
projects difficult to maintain for a long
period and involve others • Don’t try to do everything there
38. Skinny TaskRunner
• Just want a simple and “rake”-like task
runner (no sbt plugin) • Simplistic but pragmatic idea: “mainClass”
of “task” sbt project can be dispatcher of
task runner system • Tasks are written in Scala (no sbt plugin) • Not only writing code but upgrading
scala/sbt version become pretty easy
39. Tasks
// sbt settings!
// mainClass := Some("TaskRunner")!
!
// task/src/main/scala/TaskRunner.scala!
object TaskRunner extends skinny.task.TaskLauncher {!
register("assets:precompile", (params) => {!
val buildDir = params.headOption.getOrElse(“build")!
// AssetsPrecompileTask is a Scala object!
skinny.task.AssetsPrecompileTask.main(Array(buildDir))!
})!
}!
Pure Scala function!
!
// skinny task:run assets:precompile [dir]
task name
mainClass as the dispatcher
40. Use Only Essentials
• The same issue as Ruby gems, what’s
worse, Scala’s eco-system is still so
smaller than Ruby’s one • Binary incompatibility makes existing
libraries outdated every Scala major
version release • Are you really ready to fork them? • Using Java assets (e.g. commons)
internally is also worth thinking about
42. Can Feel Welcome?
• Is joining your Scala projects easy? Can
newcomer understand overview at once? • Don’t stick to doing on the sbt, don’t
disfavor using other tools (e.g. Grunt) • Well-known style (e.g. Rails style) is
preferred for collaborative works • Is asynchronosity really required now? • Indeed, your DSL is very simple but easy
to modify them (for others)?
43. Newcomers may not
know Scala well.
Attract them to Scala!
(Don’t scare them)