Database Actions Using Java 9 Stream Syntax Instead of SQL

Wednesday, February 14, 2018 - 18:00
SF Java Meetup
San Francisco

Why should Java developers need to use SQL when the same semantics can be derived directly from Java Streams? When one takes a closer look at this objective, it turns out there is a remarkable resemblance between Java streams and SQL. For example, stream operations like filter(), sorted() and flatMap() can be automatically translated to corresponding “WHERE”, “SORT” and “JOIN” SQL statements. By leveraging retrospective streams, open-source Speedment can drastically reduce your code base and allows you to write pure Java code for entire database applications. Speedment is using lazy evaluation of streams, meaning only a minimum set of data is actually pulled from the database into your application and only as the elements are needed.

In this talk, you will rediscover the power of the Stream interface in a completely new domain; relational databases. You will also learn how nicely it blends in with your existing application, even with no modifications on the database layer. This will not only increase your productivity, but also help you build safer and more maintainable Java code.

Per Minborg
CTO and cofounder Speedment, Inc.
Per Minborg is a Palo Alto based developer and architect. He is working on his third startup, serving as CTO at Speedment, focusing on in-memory databases, high-performance solutions, cloud technologies and concurrent programming. He is a regular speaker at various conferences ie. JavaOne, jdays, JUGs and Meetups. Per has 15+ US patent applications and invention disclosures. He runs the blog “Minborg’s Java Pot” which has gained over a million readers in two years year. He has several years of studies in computer science and computer security at PhD level.