A social game, by it’s nature can spread very quickly to a large user audience. Since a game is typically interactive, the speed of retrieving information needed for the user’s interactions with the system is critical. Applications which exclusively rely on synchronous data access, very often hit a scalability wall, when things get slow and their thread pools are exhausted. New paradigms like reactive programming alleviate this and provide extensive tool sets to deal with the ever growing demands of web applications.
This talk:
– Describes why Couchbase is the most appropriate solution for many video game and gaming use cases.
– Shows how to build scalable and reactive applications by making use of the Couchbase Java SDK 2.x, RxJava library and Spring Framework 5.
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017Codemotion
In this talk we'll see how to write a cloud native microservice with Go language, the microservices will be: Cloud native A twelve factor app Scalable with the GO built in concurrency Monitored with a distributed tracing system to check the latency Testable with a load test during the development Communications with different protocols.
LinkRest (http://linkrest.io) is a small HTTP-based protocol and a Java framework that rethinks how REST APIs should be built and consumed. It turns each API endpoint into a graph query engine, giving the client full control over the shape and contents of the requested data sets, while the server controls query strategy and security. The talk will start with the easy parts – how to reuse an existing Apache Cayenne ORM model for the REST service and write simple Java one-liners to get it up and running. Then we will delve into alternative backends, graph access security and parallel data processing.
Building Scalable Stateless Applications with RxJavaRick Warren
RxJava is a lightweight open-source library, originally from Netflix, that makes it easy to compose asynchronous data sources and operations. This presentation is a high-level intro to this library and how it can fit into your application.
Microservices in GO - Massimiliano Dessì - Codemotion Rome 2017Codemotion
In this talk we'll see how to write a cloud native microservice with Go language, the microservices will be: Cloud native A twelve factor app Scalable with the GO built in concurrency Monitored with a distributed tracing system to check the latency Testable with a load test during the development Communications with different protocols.
LinkRest (http://linkrest.io) is a small HTTP-based protocol and a Java framework that rethinks how REST APIs should be built and consumed. It turns each API endpoint into a graph query engine, giving the client full control over the shape and contents of the requested data sets, while the server controls query strategy and security. The talk will start with the easy parts – how to reuse an existing Apache Cayenne ORM model for the REST service and write simple Java one-liners to get it up and running. Then we will delve into alternative backends, graph access security and parallel data processing.
Building Scalable Stateless Applications with RxJavaRick Warren
RxJava is a lightweight open-source library, originally from Netflix, that makes it easy to compose asynchronous data sources and operations. This presentation is a high-level intro to this library and how it can fit into your application.
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.
Machine learning with Apache Spark on Kubernetes | DevNation Tech TalkRed Hat Developers
The first challenge for an AI/ML practitioner is to gather the data inputs needed to feed a learning model. This is where a solution such as Apache Spark’s unified DataFrame API and a scale-out compute model allows you to execute parallelized queries against SQL, Kafka, and S3. In this session, we are going to explore the use of https://radanalytics.io/ and https://opendatahub.io/ on top of Kubernetes/OpenShift to demonstrate a dynamically scalable ETL pipeline for federated data ingestion.
Cloning Running Servers with Docker and CRIU by Ross BoucherDocker, Inc.
Docker containers encapsulate everything you need to describe and run a process, but the lifecycle of a process remains the same: it starts, it runs for a while, and then it ends. This talk will demonstrate how to combine Docker with a tool called CRIU to “roll-back” running processes to an earlier state. CRIU, which stands for Checkpoint & Restore in User Space, creates a complete snapshot of the state of a process, including things like memory contents, file descriptors, and even open tcp connections. It can be used for suspending and resuming processes, or live migrating them from one machine to another. Our developer tool, Tonic, uses it to allow developers to change their code in the middle of a program without restarting from the beginning. We’ll show how we use the Docker Remote API to do this in production thousands of times a day.
KubeCon EU 2016: Kubernetes and the Potential for Higher Level InterfacesKubeAcademy
Kubernetes provides rock-solid APIs for building and running your distributed systems. Pods, Services and ReplicationControllers provide trustworthy and scalable abstractions that make solving real-world infrastructure problems simpler. But that doesn’t mean interacting with those low-level primitives will be the only option for developers and operators.
Sched Link: http://sched.co/67dA
Seven perilous pitfalls to avoid with Java | DevNation Tech TalkRed Hat Developers
Developers and security: It’s a lot more than just turning on SSL. In this session we’re going to learn to think differently about designing and coding in Java so that the application is less open to being attacked and (bonus) is often of higher quality. This talk will cover seven types of development issues that can get your application into trouble. With code examples (of course), we’ll explore a series of common code pitfalls and explain how to design and code differently. There is much to learn when creating a secure application - take your first steps here.
Docker and Go: why did we decide to write Docker in Go?Jérôme Petazzoni
Docker is currently one of the most popular Go projects. After a (quick) Docker intro, we will discuss why we picked Go, and how it turned out for us.
We tried to list all the drawbacks and minor inconveniences that we met while developing Docker; not to complain about Go, but to give the audience an idea of what to expect. Depending on your project, those drawbacks could be minor inconveniences or showstoppers; we thought you would want to know about them to help you to make the right choice!
Original slides from Ryan Dahl's NodeJs intro talkAarti Parikh
These are the original slides from the nodejs talk. I was surprised not find them on slideshare so adding them. The video link is here https://www.youtube.com/watch?v=ztspvPYybIY
I bet, it's not a first time when you meet a word 'serverless', but I still hope that this time I persuade you to try it out. And for those who are familiar with AWS lambdas already I have a few handy tricks and tools to share. In my presentation, I'll show how to render and deploy an isomorphic React Redux application on AWS Lambda step by step.
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.
Machine learning with Apache Spark on Kubernetes | DevNation Tech TalkRed Hat Developers
The first challenge for an AI/ML practitioner is to gather the data inputs needed to feed a learning model. This is where a solution such as Apache Spark’s unified DataFrame API and a scale-out compute model allows you to execute parallelized queries against SQL, Kafka, and S3. In this session, we are going to explore the use of https://radanalytics.io/ and https://opendatahub.io/ on top of Kubernetes/OpenShift to demonstrate a dynamically scalable ETL pipeline for federated data ingestion.
Cloning Running Servers with Docker and CRIU by Ross BoucherDocker, Inc.
Docker containers encapsulate everything you need to describe and run a process, but the lifecycle of a process remains the same: it starts, it runs for a while, and then it ends. This talk will demonstrate how to combine Docker with a tool called CRIU to “roll-back” running processes to an earlier state. CRIU, which stands for Checkpoint & Restore in User Space, creates a complete snapshot of the state of a process, including things like memory contents, file descriptors, and even open tcp connections. It can be used for suspending and resuming processes, or live migrating them from one machine to another. Our developer tool, Tonic, uses it to allow developers to change their code in the middle of a program without restarting from the beginning. We’ll show how we use the Docker Remote API to do this in production thousands of times a day.
KubeCon EU 2016: Kubernetes and the Potential for Higher Level InterfacesKubeAcademy
Kubernetes provides rock-solid APIs for building and running your distributed systems. Pods, Services and ReplicationControllers provide trustworthy and scalable abstractions that make solving real-world infrastructure problems simpler. But that doesn’t mean interacting with those low-level primitives will be the only option for developers and operators.
Sched Link: http://sched.co/67dA
Seven perilous pitfalls to avoid with Java | DevNation Tech TalkRed Hat Developers
Developers and security: It’s a lot more than just turning on SSL. In this session we’re going to learn to think differently about designing and coding in Java so that the application is less open to being attacked and (bonus) is often of higher quality. This talk will cover seven types of development issues that can get your application into trouble. With code examples (of course), we’ll explore a series of common code pitfalls and explain how to design and code differently. There is much to learn when creating a secure application - take your first steps here.
Docker and Go: why did we decide to write Docker in Go?Jérôme Petazzoni
Docker is currently one of the most popular Go projects. After a (quick) Docker intro, we will discuss why we picked Go, and how it turned out for us.
We tried to list all the drawbacks and minor inconveniences that we met while developing Docker; not to complain about Go, but to give the audience an idea of what to expect. Depending on your project, those drawbacks could be minor inconveniences or showstoppers; we thought you would want to know about them to help you to make the right choice!
Original slides from Ryan Dahl's NodeJs intro talkAarti Parikh
These are the original slides from the nodejs talk. I was surprised not find them on slideshare so adding them. The video link is here https://www.youtube.com/watch?v=ztspvPYybIY
I bet, it's not a first time when you meet a word 'serverless', but I still hope that this time I persuade you to try it out. And for those who are familiar with AWS lambdas already I have a few handy tricks and tools to share. In my presentation, I'll show how to render and deploy an isomorphic React Redux application on AWS Lambda step by step.
For just over a year, Swift has been available as a formal release on Linux and frameworks like Kitura and Vapor have made it possible to build mobile backends and web applications on the server. Running Server Swift is however not your own option for becoming a fullstack engineer and building backends in Swift. Amazon, Microsoft, Google, IBM and others are all also providing the ability to run Serverless (aka Lambdas or Functions), with some of those supporting the use of Swift.
This session will introduce you to Serverless Swift, highlight how it compares to Server Swift and show you some applications that have been built with Server(less) Swift.
Playing With Fire - An Introduction to Node.jsMike Hagedorn
node.js is an evented server-side Javascript framework powered by the Google V8 Javascript engine. It is a platform ideal for creating highly scalable web applications. It has the same simplicity of frameworks such as Sinatra, but is designed to be more peformant from the ground up. This performance is achieved by making all network I/O non blocking and all file I/O asynchronous. We will go over how that impacts the development experience, and walk through a simple web application. Javascript is foundational to this type of I/O because it is already evented by design. We will also take a brief look a similar evented frameworks such as ruby`s EventMachine.
This talk is a very quick intro to Docker, Terraform, and Amazon's EC2 Container Service (ECS). In just 15 minutes, you'll see how to take two apps (a Rails frontend and a Sinatra backend), package them as Docker containers, run them using Amazon ECS, and to define all of the infrastructure-as-code using Terraform.
Today there are a lot of cloud providers, with a wide range of offers. Web projects usually have continuously changing needs: what worked well yesterday may not be enough today. These two facts became quite obvious for us while migrating a large PHP application from Rackspace to Amazon. In this session I’d like to share this experience highlighting infrastructure and code evolution, migration steps, cost analisys, issues.
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
HA websites are where the rubber meets the road - at 200km/h. Traditional separation of dev and ops just doesn't cut it.
Everything is related to everything. Code relies on performant and resilient infrastructure, but highly performant infrastructure will only get a poorly written application so far. Worse still, root cause analysis in HA sites will more often than not identify problems that don't clearly belong to either devs or ops.
The two options are collaborate or die.
This talk will introduce 3 core principles for improving collaboration between operations and development teams: consistency, repeatability, and visibility. These principles will be investigated with real world case studies and associated technologies audience members can start using now. In particular, there will be a focus on:
- fast provisioning of test environments with configuration management
- reliable and repeatable automated deployments
- application and infrastructure visibility with statistics collection, logging, and visualisation
A Deep Dive into Query Execution Engine of Spark SQLDatabricks
Spark SQL enables Spark to perform efficient and fault-tolerant relational query processing with analytics database technologies. The relational queries are compiled to the executable physical plans consisting of transformations and actions on RDDs with the generated Java code. The code is compiled to Java bytecode, executed at runtime by JVM and optimized by JIT to native machine code at runtime. This talk will take a deep dive into Spark SQL execution engine. The talk includes pipelined execution, whole-stage code generation, UDF execution, memory management, vectorized readers, lineage based RDD transformation and action.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...informapgpstrackings
Keep tabs on your field staff effortlessly with Informap Technology Centre LLC. Real-time tracking, task assignment, and smart features for efficient management. Request a live demo today!
For more details, visit us : https://informapuae.com/field-staff-tracking/
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
Bulding a reactive game engine with Spring 5 & Couchbase
1. Building reac-ve game engine
with Spring 5 & Couchbase
Alex Derkach
Senior So0ware Engineer @ Play7ka
2. @alexsderkach
‣ Java addict since ’12
‣ SSE @ Slotomania Feature Team
‣ Ac7ve Couchbase & Spring user
‣ All things reac7ve & distributed
2h>p://alexsderkach.io
slides
3. Plan for today
3
‣ Why Couchbase + Quick Overview
‣ Reac7ve founda7on behind Spring 5
‣ Demonstra7on & Case Study
‣ Summary
9. What is Couchbase?
9
‣ Key-Document storage
‣ Consistent high performance
‣ Scale with single “push” buTon
‣ Zero-down7me opera7ons
10. Server
10
Couchbase Architecture
Cluster
Manager
Data Service
Index Service
Query Service
Cache
Storage
Server
Cluster
Manager
Data Service
Index Service
Query Service
Cache
Storage
Server
Cluster
Manager
Data Service
Index Service
Query Service
Cache
Storage
Server
Cluster
Manager
Data Service
Index Service
Query Service
Cache
Storage
Server
Cluster
Manager
Data Service
Index Service
Query Service
Cache
Storage
Couchbase Cluster
28. Spring 5
28
‣ Based on Reactor Core 3
‣ Reac7ve HTTP Server Abstrac7on
‣ Compa7ble with RxJava 1 & 2
‣ Compa7ble with Java 9
‣ Many more!
29. 29
‣ Func7onal, declara7ve programming model
‣ Combine, transform, reduce sequences (500+ methods)
‣ Reac7ve Streams ready
‣ Focus on what, not how
Reactor 3 Crash Course
Flux / Mono Subscriber
0..N Data
+ 0..1 (Error, Completed)
Backpressure
regulation
30. 30
Learning to Flux
OR Flux.create(sink -> *blocking call*);Mono.create(sink -> *blocking call*);
31. 31
Learning to Flux
Mono.create(sink -> {
val result = repository.findOne(1L);
if (result.isPresent()) {
sink.success(result.get());
} else {
sink.error(new UserNotFoundException(id));
}
})
.subscribe(System.out::println);
Flux.create(sink -> *blocking call*);Mono.create(sink -> *blocking call*); OR
32. 32
Learning to Flux
Mono.create(sink -> {
val result = repository.findOne(1L);
if (result.isPresent()) {
sink.success(result.get());
} else {
sink.error(new UserNotFoundException(id));
}
})
.subscribe(System.out::println);
Flux.create(sink -> *blocking call*);Mono.create(sink -> *blocking call*);
Flux.create(sink -> {
val ids = asList(1L, 2L, 3L);
val result = userRepository.findAll(ids);
for (User user : result) {
sink.next(user);
}
sink.complete();
})
.subscribe(System.out::println);
OR
33. 33
Flux.create(..., );
enum OverflowStrategy {
// Completely ignore downstream backpressure requests.
IGNORE,
// Signal an IllegalStateException when the downstream
can't keep up
ERROR,
// Drop the incoming signal if the downstream is not
ready to receive it.
DROP,
// Downstream will get only the latest signals from
upstream.
LATEST,
// Buffer all signals if the downstream can't keep up.
BUFFER
}
Backpressure
34. 34
Flux.<User>create(sink -> {
userRepository.findAll(ids).forEach(sink::next);
sink.complete();
})
.filter(user -> user.getGender() == MALE)
.map(user -> new User(user.getId(), user.getName().toUpperCase()))
.buffer(20)
.flatMap(users ->
Flux.create(sink -> {
userRepository.save(users).forEach(sink::next);
sink.complete();
})
.subscribeOn(Schedulers.elastic())
)
.subscribeOn(Schedulers.elastic())
.subscribe(System.out::println, System.err::println);
I have a Flux. What’s next?
35. 35
Flux.<User>create(sink -> {
userRepository.findAll(ids).forEach(sink::next);
sink.complete();
})
.filter(user -> user.getGender() == MALE)
.map(user -> new User(user.getId(), user.getName().toUpperCase()))
.buffer(20)
.flatMap(users ->
Flux.create(sink -> {
userRepository.save(users).forEach(sink::next);
sink.complete();
})
.subscribeOn(Schedulers.elastic())
)
.subscribeOn(Schedulers.elastic())
.subscribe(System.out::println, System.err::println);
I have a Flux. What’s next?
42. 42
spring-web spring-webflux
@RestController
public class UserController {
@GetMapping("/users/{id}")
public User get(long id) { }
@PostMapping("/users/")
public User create(User user) { }
@PutMapping("/users/{id}")
public User update(long id, User user) { }
@DeleteMapping("/users/{id}")
public User delete(long id) { }
}
@RestController
public class UserController {
@GetMapping("/users/{id}")
public User get(long id) { }
@PostMapping("/users/")
public User create(User user) { }
@PutMapping("/users/{id}")
public User update(long id, User user) { }
@DeleteMapping("/users/{id}")
public User delete(long id) { }
}
43. 43
spring-web spring-webflux
@RestController
public class UserController {
@GetMapping("/users/{id}")
public User get(long id) { }
@PostMapping("/users/")
public User create(User user) { }
@PutMapping("/users/{id}")
public User update(long id, User user) { }
@DeleteMapping("/users/{id}")
public User delete(long id) { }
}
@RestController
public class UserController {
@GetMapping("/users/{id}")
public Mono<User> get(long id) { }
@PostMapping("/users/")
public Mono<User> create(Mono<User> user) { }
@PutMapping("/users/{id}")
public Mono<User> update(long id,
Mono<User> user) { }
@DeleteMapping("/users/{id}")
public Mono<User> delete(long id) { }
}
55. 55
Automa-c Op-miza-ons
‣ Macro-fusion - replacing 2+ subsequent operators with a single operator:
1. map(A) = B
2. map(B) = C ƒ(A) = D
3. filter(C) = D
56. 56
‣ Macro-fusion - replacing 2+ subsequent operators with a single operator:
1. map(A) = B
2. map(B) = C ƒ(A) = D
3. filter(C) = D
‣ Micro-fusion - operators that end in an output queue and operators star7ng with
a front-queue could share the same Queue instance
1. 0..100 = B
2. map(B) = C [0..100] <-> map <-> groupBy <-> 🙄
3. groupBy(C) = D
Automa-c Op-miza-ons
push
queuequeue request(1) request(1)
push
request(1)
push
57. ‣ Macro-fusion - replacing 2+ subsequent operators with a single operator:
1. map(A) = B
2. map(B) = C ƒ(A) = D
3. filter(C) = D
‣ Micro-fusion - operators that end in an output queue and operators star7ng with
a front-queue could share the same Queue instance
1. 0..100 = B
2. map(B) = C [0..100] <- map <-> groupBy <- 🙄
3. groupBy(C) = D
57
Automa-c Op-miza-ons
poll
queuequeue
poll
request(1)
push
58. 58
Flux against the world
‣ Stream, Op-onal, CompletableFuture - solve specific tasks
‣ Reac-ve Libraries are universal
61. 61
‣ Pipeline = steps of transforma-ons
How do I test? #unit
62. 62
How do I test? #unit
🛴 🏍 🚐
transforma-on #1 transforma-on #2
‣ Pipeline = steps of transforma-ons
63. 63
How do I test? #unit
Input ExpectedTransformer
🛴 🏍 🚐
transforma-on #1 transforma-on #2
‣ Pipeline = steps of transforma-ons
64. 64
How do I test? #unit
🛴 🏍 🚐
transforma-on #1 transforma-on #2
‣ Pipeline = steps of transforma-ons
Input ExpectedTransformer
65. @Test
public void testEmojiSource() {
Flux<String> source = emojiSource();
Iterable<String> values = source.toIterable();
assertEquals(asList("🙈", "🙉", "🙊"), values);
}
@Test
public void testWelcomeSource() {
Mono<String> source = welcomeSource();
String value = source.block();
assertEquals("Hello", value);
}
65
How to verify expecta-ons?
h>ps://projectreactor.io/docs/core/release/reference/docs/index.html#tes-ng
1
@Test
public void testEmojiSource() {
Flux<String> source = emojiSource();
StepVerifier.create(source)
.expectNext("🙈", "🙉", "🙊")
.as("expect 3 more")
.expectNextCount(3)
.thenAwait(Duration.ofSeconds(3))
.expectNextMatches(v -> v.startsWith("O_O"))
.as("expect non empty batch")
.thenConsumeWhile(v -> !v.isEmpty())
.expectNextCount(1)
.verifyComplete();
}
2
3
1
2
3
convert to synchronous use StepVerifier
1
3
2
🏍
66. 66
How to generate input?🛴
@Test
public void testEmojiSource() {
Flux<String> source = Flux.just("🙈", "🙉", "🙊");
Iterable<String> values = source.toIterable();
assertEquals(asList("🙈", "🙉", "🙊"), values);
}
@Test
public void testWelcomeSource() {
Mono<String> source = Mono.just("Hello");
String value = source.block();
assertEquals("Hello", value);
}
67. 67
How to generate input?
Emit specific signals with TestPublisher<T>
‣ next(T…) will trigger 1..N onNext signals
‣ emit(T…) will do the same & complete
‣ complete() will terminate with onComplete signal
‣ error(Throwable) will terminate with an onError signal
🛴
68. 68
How to get pre>y stack-trace?
Ac-vate debug mode
Hooks.onOperator(Hooks.OperatorHook::operatorStacktrace);
Error has been observed by the following operator(s):
|_ Flux.map(FakeRepository.java:27)
|_ Flux.map(FakeRepository.java:28)
|_ Flux.filter(FakeUtils1.java:29)
|_ Flux.transform(GuideDebuggingExtraTests.java:41)
|_ Flux.elapsed(FakeUtils2.java:30)
|_ Flux.transform(GuideDebuggingExtraTests.java:42)
69. 69
How do I test Couchbase? #integra-on
without N1QL with N1QL
OR
70. 70
Future
‣ Flow API - Java 9
‣ Non-blocking JDBC spec (Java 10?)
‣ More non-blocking Spring modules
‣ …
71. Summary
71
‣ K-V Storage - perfect for video games
‣ Design Non-Blocking by Default
‣ RxJava and Reactor are friends
‣ Spring unites everyone
72. References
72
‣ Why Couchbase chose RxJava
hTps://goo.gl/dWeS35
‣ Reac7ve Spring by Josh Long
hTps://goo.gl/EXtJrB
‣ Developing Reac7ve applica7ons with Reac7ve Streams
hTps://goo.gl/eeNaAh
‣ Spring Boot 2.0 change-log
hTps://goo.gl/j8HFuY