In this talk, Avinder introduces a new type-safe API for the ZIO DynamoDB ligrary that can prevent many errors at compile time while remaining user-friendly.
Introducing Zio DynamoDB - a new Scala library for Simple, type-safe, and eff...AvinderBahra
DynamoDB powers many cloud-scale applications, with its robust horizontal scalability and uptime. Yet, interacting with the Java SDK is error-prone and tedious. In this presentation, Avinder Bahra presents ZIO DynamoDB, a new library by Avi and Adam Johnson designed to make interacting with DynamoDB easy, type-safe, testable, and productive.
Esoft Metro Campus - Diploma in Web Engineering - (Module VII) Advanced PHP Concepts
(Template - Virtusa Corporate)
Contents:
Arrays
Indexed Arrays
Associative Arrays
Multidimensional arrays
Array Functions
PHP Objects and Classes
Creating an Object
Properties of Objects
Object Methods
Constructors
Inheritance
Method overriding
PHP Strings
printf() Function
String Functions
PHP Date/Time Functions
time() Function
getdate() Function
date() Function
mktime() function
checkdate() function
PHP Form Handling
Collecting form data with PHP
GET vs POST
Data validation against malicious code
Required fields validation
Validating an E-mail address
PHP mail() Function
Using header() function to redirect user
File Upload
Processing the uploaded file
Check if File Already Exists
Limit File Size
Limit File Type
Check if image file is an actual image
Uploading File
Cookies
Sessions
"The joy of Scala" - Maxim Novak / Wix
Around eight years ago I started my journey as a developer. Since then, I've played around with many languages and thought that C# offers the best developer productivity. After joining Wix two years ago, I was exposed to the amazing world of Scala and Functional Programming and never looked back.
In Scala the code is much more concise, less ceremonious, immutable by default, combines functional with object oriented, seamlessly interoperates with Java, and many software engineering patterns are already baked into the language. Most importantly - Scala is FUN! By the end of the session you too will, hopefully, convert to Scala and never look back.
Recording of the lecture (Hebrew) - https://youtu.be/TcnYTwff2xU
Peter Lawrey is the CEO of Chronicle Software. He has 7 years experience working as a Java developer for investment banks and trading firms. Chronicle Software helps companies migrate to high performance Java code and was involved in one of the first large Java 8 projects in production in December 2014. The company offers workshops, training, consulting and custom development services. The talk will cover reading and writing lambdas, capturing vs non-capturing lambdas, transforming imperative code to streams, mixing imperative and functional code, and taking Q&A.
Implicit parameters, when to use them (or not)!Julien Truffaut
Implicits values are one of the unique features of Scala but they are very complex and easy to misuse. So in this talk we will discuss various valid use cases and anti-pattern for implicits.
You don’t need to be a Scala expert, I will also present how implicit works at high level.
JavaScript is evolving. It’s an exciting time to be involved with this ubiquitous language of the web. Every year, we get exciting new features landing as part of the language. Let’s explore the freshly released features that were part of the 2019 ECMAScript specification. We’ll also briefly explore the process of how new features get proposed and added to the language, as well as the leading contenders expected to land in ES2020.
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)Amazon Web Services
Chalice is a new Python serverless microframework for AWS. In this session, we'll show how to use it to create serverless REST APIs that use Amazon API Gateway and AWS Lambda. We'll deploy our first REST API in less than 30 seconds. Several live demos will show how to build on this example to leverage other Chalice capabilities, including advanced URL routing, automatic policy generation, and Swagger exports.
Introducing Zio DynamoDB - a new Scala library for Simple, type-safe, and eff...AvinderBahra
DynamoDB powers many cloud-scale applications, with its robust horizontal scalability and uptime. Yet, interacting with the Java SDK is error-prone and tedious. In this presentation, Avinder Bahra presents ZIO DynamoDB, a new library by Avi and Adam Johnson designed to make interacting with DynamoDB easy, type-safe, testable, and productive.
Esoft Metro Campus - Diploma in Web Engineering - (Module VII) Advanced PHP Concepts
(Template - Virtusa Corporate)
Contents:
Arrays
Indexed Arrays
Associative Arrays
Multidimensional arrays
Array Functions
PHP Objects and Classes
Creating an Object
Properties of Objects
Object Methods
Constructors
Inheritance
Method overriding
PHP Strings
printf() Function
String Functions
PHP Date/Time Functions
time() Function
getdate() Function
date() Function
mktime() function
checkdate() function
PHP Form Handling
Collecting form data with PHP
GET vs POST
Data validation against malicious code
Required fields validation
Validating an E-mail address
PHP mail() Function
Using header() function to redirect user
File Upload
Processing the uploaded file
Check if File Already Exists
Limit File Size
Limit File Type
Check if image file is an actual image
Uploading File
Cookies
Sessions
"The joy of Scala" - Maxim Novak / Wix
Around eight years ago I started my journey as a developer. Since then, I've played around with many languages and thought that C# offers the best developer productivity. After joining Wix two years ago, I was exposed to the amazing world of Scala and Functional Programming and never looked back.
In Scala the code is much more concise, less ceremonious, immutable by default, combines functional with object oriented, seamlessly interoperates with Java, and many software engineering patterns are already baked into the language. Most importantly - Scala is FUN! By the end of the session you too will, hopefully, convert to Scala and never look back.
Recording of the lecture (Hebrew) - https://youtu.be/TcnYTwff2xU
Peter Lawrey is the CEO of Chronicle Software. He has 7 years experience working as a Java developer for investment banks and trading firms. Chronicle Software helps companies migrate to high performance Java code and was involved in one of the first large Java 8 projects in production in December 2014. The company offers workshops, training, consulting and custom development services. The talk will cover reading and writing lambdas, capturing vs non-capturing lambdas, transforming imperative code to streams, mixing imperative and functional code, and taking Q&A.
Implicit parameters, when to use them (or not)!Julien Truffaut
Implicits values are one of the unique features of Scala but they are very complex and easy to misuse. So in this talk we will discuss various valid use cases and anti-pattern for implicits.
You don’t need to be a Scala expert, I will also present how implicit works at high level.
JavaScript is evolving. It’s an exciting time to be involved with this ubiquitous language of the web. Every year, we get exciting new features landing as part of the language. Let’s explore the freshly released features that were part of the 2019 ECMAScript specification. We’ll also briefly explore the process of how new features get proposed and added to the language, as well as the leading contenders expected to land in ES2020.
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)Amazon Web Services
Chalice is a new Python serverless microframework for AWS. In this session, we'll show how to use it to create serverless REST APIs that use Amazon API Gateway and AWS Lambda. We'll deploy our first REST API in less than 30 seconds. Several live demos will show how to build on this example to leverage other Chalice capabilities, including advanced URL routing, automatic policy generation, and Swagger exports.
This presentation introduces the main features of Scala, an object oriented and functional programming language. The main focus of the slides is to show how the language implements natively some of the patterns and best practices that are no present in other programming languages, such as Java, C++ and so on.
In detail, the presentation spans these concepts:
- Language's main syntax
- Classes, abstract classes, objects and traits (mixin)
- The Option class
- An introduction to generics
- Implicit classes
- Functions
- Recursion (simple and tail)
- Currying
- Call by value / name
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
An overview how to realize code generation of languages on the JVM that implement other class layouts than the Java programming languages. As an example, the inline-mock-maker for Mockito is discussed which supports languages like Kotlin that make any property final by default.
This document discusses classes and objects in C++. It begins by explaining the differences between structures and classes, noting that classes avoid limitations of structures by allowing data hiding and treating class types as built-in types. The rest of the document covers key aspects of classes like class declarations, defining member functions inside and outside classes, creating objects, accessing members, static members, arrays of objects, and passing objects to functions by value and reference.
This document discusses various data types and conversions between them in Java. It defines variables of different primitive data types like boolean, byte, char, int etc and assigns values. It then demonstrates conversions between boolean and other data types by assigning the result of a ternary operator to the other variables. The values before and after conversions are printed to check the results. This allows understanding implicit and explicit type conversions between different data types in Java.
This document provides an overview of Angular fundamentals including components, directives, pipes, services, and reactive programming concepts. It defines components as reusable UI building blocks that control a view. It demonstrates core directives like NgFor, NgIf, and NgSwitch. It also covers lifecycle hooks, built-in and custom pipes, dependency injection with services, RxJS observables, and reactive programming concepts like streams and operators.
Quest 1 define a class batsman with the following specificationsrajkumari873
The document defines several Java classes with private and public members to model different real-world entities. This includes classes for batsmen (with code, name, stats, and average calculation), tests (with code, description, candidates, and center calculation), flights (with number, destination, distance, and fuel calculation), books (with number, title, price, purchase calculation), reports (with admission, name, marks, and average calculation), students (with admission, name, subjects, and total calculation), and telephone bills (with readings, calls, name, charges and calculation). Public member functions allow entering and displaying data, while private functions perform calculations.
The document discusses Scala concepts including higher-order functions, anonymous functions, currying, tail recursion, classes and objects, properties with getters and setters, object-private fields, auxiliary constructors, primary constructors, nested classes, and singleton objects. It provides code examples to illustrate these Scala features and explains how they work and how they compare to similar concepts in other languages like Java. The document is intended as a lesson on these Scala programming concepts.
Boost delivery stream with code discipline engineeringMiro Wengner
Gang Of Four has done an amazing job of summarising and identifying common challenges that business has faced in the past. The evolution of application design has brought their work into a new context, much like the improvements to Java that have been added to the platform in recent years. Such progress leads to the conclusion that design patterns and anti-patterns need to be reconsidered. This presentation reveals how to increase delivery flow and improve the fast-feedback loop while identifying bottlenecks and removing obstacles from the codebase. During the presentation, we will uncover the nature of several anti-patterns and smoothly translate them into design patterns as required by everyday business. Together, we explore similar approaches provide by another JVM languages like Kotlin or Scala to reveal the power and simplicity of Java. This helps increase productivity while improving the quality of daily decisions supported by proper visualisation from Java Flight Recorder
This document provides an overview of Angular fundamentals including components, directives, lifecycle hooks, services, and reactive programming concepts. It defines what components are and how they are declared with metadata and templates. It explains structural and attribute directives like NgFor, NgIf, and NgClass. It covers lifecycle hooks such as ngOnInit, ngOnChanges, and ngOnDestroy. The document also discusses services, dependency injection, and reactive programming concepts like Observables, operators, and marble diagrams.
This document contains instructions and code for several programming assignments. It includes:
1. An email address checker program that parses a student email and displays the name and school.
2. A dice simulation program that rolls a dice multiple times and counts the frequency of each result.
3. Code for classes in an inheritance hierarchy including Person, Employee, Customer, PartTime, and FullTime with methods to input and display object details.
4. Methods to compare Employee and FullTime objects and a test program to demonstrate.
5. An abstract Account class and subclasses Current and Savings with methods to input and display account details.
So in summary, it provides full programming assignments on parsing emails,
Datagrids with Symfony 2, Backbone and BackgridGiorgio Cefaro
These are the slides of the code-centered presentation I did with Eugenio Pombi at the Javascript User Group Roma and the PHP User Group Roma.
In this presentation we try to show many powerful features of symfony2 and its bundles to work as a backend system for single page applications.
On the client side we describe how we made a javascript editable grid using Backbone.js and its plugin for grids Backgrid.js.
Datagrids with Symfony 2, Backbone and Backgrideugenio pombi
This document discusses using Backbone, Backgrid, and Symfony to build a datagrid application. It covers:
1) Setting up requirements including Symfony, Backbone dependencies, and FOSRestBundle.
2) Building Backbone models, collections, and associations to retrieve and represent ticket data.
3) Implementing a Backgrid grid with columns to display the ticket data.
4) Examples of extending Backgrid with features like select editors, toggle cells, and computed fields.
5) Testing the Backbone collections and API endpoints with sample test code.
Vadym Khondar is a senior software engineer with 8 years of experience, including 2.5 years at EPAM. He leads a development team that works on web and JavaScript projects. The document discusses reactive programming, including its benefits of responsiveness, resilience, and other qualities. Examples demonstrate using streams, behaviors, and other reactive concepts to write more declarative and asynchronous code.
Dart is a productive way to develop future JavaScript apps today. It comes with a complete set of development tools and will help ease development of EcmaScript 6 in 2016. Dart simplifies development by allowing optional variable types and single inheritance for classes. It supports concurrency without threads. Popular IDEs like IntelliJ, WebStorm, and Eclipse support Dart development. Code can run in the Dart VM for fast feedback or compile to JavaScript to run in browsers.
This document provides an overview and comparison of different approaches for building mobile applications, including native and hybrid approaches. It discusses React Native specifically and its advantages, such as allowing developers to build mobile apps for Android and iOS using React with a single codebase, while still providing access to native platform features and a native user experience. It also covers topics like navigation, testing, publishing apps, and some challenges with React Native like dealing with JavaScript errors in production.
The document discusses implementing an Entity-Attribute-Value (EAV) pattern for ActiveRecord models. It describes saving entity types as strings in an entity table, keeping attributes directly in the model, and using a polymorphic association between the entity and value. The implementation creates tables for each attribute type (string, integer, float, boolean), generates attribute models, and adds getter/setter methods to the entity model to access attribute values. It also discusses more advanced functionality like querying, ordering, and selecting specific attributes.
Designing REST API automation tests in KotlinDmitriy Sobko
The document discusses designing REST API automation tests in Kotlin. It covers microservices architecture, REST APIs, backend testing principles, the Kotlin programming language, Cucumber BDD framework, Spring Boot framework, and how to combine these tools for testing. The goals are to create tests that are stable, resistant to code changes, fast, extensible, and easily supported.
Deep Dive Into Swift - Presented at Coffee@DBG
In the previous month, Coffe@DBG Covered the basics of Swift, Apple's new programming language. This session introduces some of handpicked interesting features of Swift.
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
This is a talk I gave at the spring 2013 AngleBrackets/DevIntersection conference in Las Vegas.
HTML5 is all the rage these days but where do you look to find robust examples of using it along with jQuery, client-side templates, Ajax calls, data access technologies, and more? In this session, Dan Wahlin will walk through an application that demonstrates how key HTML5 technologies can be integrated and used to present data to users in different ways. Topics covered include exposing data to the client using RESTful services created using the new ASP.NET Web API, using Handlebars templates to render data, JavaScript techniques for structuring code, the role of HTML5 semantic tags, as well as how technologies such as the canvas, SVG, and video can be used. If you want to learn server-side as well as client-side techniques and strategies then this session is for you.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
More Related Content
Similar to Introducing the ZIO DynamoDB Type Safe API
This presentation introduces the main features of Scala, an object oriented and functional programming language. The main focus of the slides is to show how the language implements natively some of the patterns and best practices that are no present in other programming languages, such as Java, C++ and so on.
In detail, the presentation spans these concepts:
- Language's main syntax
- Classes, abstract classes, objects and traits (mixin)
- The Option class
- An introduction to generics
- Implicit classes
- Functions
- Recursion (simple and tail)
- Currying
- Call by value / name
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
An overview how to realize code generation of languages on the JVM that implement other class layouts than the Java programming languages. As an example, the inline-mock-maker for Mockito is discussed which supports languages like Kotlin that make any property final by default.
This document discusses classes and objects in C++. It begins by explaining the differences between structures and classes, noting that classes avoid limitations of structures by allowing data hiding and treating class types as built-in types. The rest of the document covers key aspects of classes like class declarations, defining member functions inside and outside classes, creating objects, accessing members, static members, arrays of objects, and passing objects to functions by value and reference.
This document discusses various data types and conversions between them in Java. It defines variables of different primitive data types like boolean, byte, char, int etc and assigns values. It then demonstrates conversions between boolean and other data types by assigning the result of a ternary operator to the other variables. The values before and after conversions are printed to check the results. This allows understanding implicit and explicit type conversions between different data types in Java.
This document provides an overview of Angular fundamentals including components, directives, pipes, services, and reactive programming concepts. It defines components as reusable UI building blocks that control a view. It demonstrates core directives like NgFor, NgIf, and NgSwitch. It also covers lifecycle hooks, built-in and custom pipes, dependency injection with services, RxJS observables, and reactive programming concepts like streams and operators.
Quest 1 define a class batsman with the following specificationsrajkumari873
The document defines several Java classes with private and public members to model different real-world entities. This includes classes for batsmen (with code, name, stats, and average calculation), tests (with code, description, candidates, and center calculation), flights (with number, destination, distance, and fuel calculation), books (with number, title, price, purchase calculation), reports (with admission, name, marks, and average calculation), students (with admission, name, subjects, and total calculation), and telephone bills (with readings, calls, name, charges and calculation). Public member functions allow entering and displaying data, while private functions perform calculations.
The document discusses Scala concepts including higher-order functions, anonymous functions, currying, tail recursion, classes and objects, properties with getters and setters, object-private fields, auxiliary constructors, primary constructors, nested classes, and singleton objects. It provides code examples to illustrate these Scala features and explains how they work and how they compare to similar concepts in other languages like Java. The document is intended as a lesson on these Scala programming concepts.
Boost delivery stream with code discipline engineeringMiro Wengner
Gang Of Four has done an amazing job of summarising and identifying common challenges that business has faced in the past. The evolution of application design has brought their work into a new context, much like the improvements to Java that have been added to the platform in recent years. Such progress leads to the conclusion that design patterns and anti-patterns need to be reconsidered. This presentation reveals how to increase delivery flow and improve the fast-feedback loop while identifying bottlenecks and removing obstacles from the codebase. During the presentation, we will uncover the nature of several anti-patterns and smoothly translate them into design patterns as required by everyday business. Together, we explore similar approaches provide by another JVM languages like Kotlin or Scala to reveal the power and simplicity of Java. This helps increase productivity while improving the quality of daily decisions supported by proper visualisation from Java Flight Recorder
This document provides an overview of Angular fundamentals including components, directives, lifecycle hooks, services, and reactive programming concepts. It defines what components are and how they are declared with metadata and templates. It explains structural and attribute directives like NgFor, NgIf, and NgClass. It covers lifecycle hooks such as ngOnInit, ngOnChanges, and ngOnDestroy. The document also discusses services, dependency injection, and reactive programming concepts like Observables, operators, and marble diagrams.
This document contains instructions and code for several programming assignments. It includes:
1. An email address checker program that parses a student email and displays the name and school.
2. A dice simulation program that rolls a dice multiple times and counts the frequency of each result.
3. Code for classes in an inheritance hierarchy including Person, Employee, Customer, PartTime, and FullTime with methods to input and display object details.
4. Methods to compare Employee and FullTime objects and a test program to demonstrate.
5. An abstract Account class and subclasses Current and Savings with methods to input and display account details.
So in summary, it provides full programming assignments on parsing emails,
Datagrids with Symfony 2, Backbone and BackgridGiorgio Cefaro
These are the slides of the code-centered presentation I did with Eugenio Pombi at the Javascript User Group Roma and the PHP User Group Roma.
In this presentation we try to show many powerful features of symfony2 and its bundles to work as a backend system for single page applications.
On the client side we describe how we made a javascript editable grid using Backbone.js and its plugin for grids Backgrid.js.
Datagrids with Symfony 2, Backbone and Backgrideugenio pombi
This document discusses using Backbone, Backgrid, and Symfony to build a datagrid application. It covers:
1) Setting up requirements including Symfony, Backbone dependencies, and FOSRestBundle.
2) Building Backbone models, collections, and associations to retrieve and represent ticket data.
3) Implementing a Backgrid grid with columns to display the ticket data.
4) Examples of extending Backgrid with features like select editors, toggle cells, and computed fields.
5) Testing the Backbone collections and API endpoints with sample test code.
Vadym Khondar is a senior software engineer with 8 years of experience, including 2.5 years at EPAM. He leads a development team that works on web and JavaScript projects. The document discusses reactive programming, including its benefits of responsiveness, resilience, and other qualities. Examples demonstrate using streams, behaviors, and other reactive concepts to write more declarative and asynchronous code.
Dart is a productive way to develop future JavaScript apps today. It comes with a complete set of development tools and will help ease development of EcmaScript 6 in 2016. Dart simplifies development by allowing optional variable types and single inheritance for classes. It supports concurrency without threads. Popular IDEs like IntelliJ, WebStorm, and Eclipse support Dart development. Code can run in the Dart VM for fast feedback or compile to JavaScript to run in browsers.
This document provides an overview and comparison of different approaches for building mobile applications, including native and hybrid approaches. It discusses React Native specifically and its advantages, such as allowing developers to build mobile apps for Android and iOS using React with a single codebase, while still providing access to native platform features and a native user experience. It also covers topics like navigation, testing, publishing apps, and some challenges with React Native like dealing with JavaScript errors in production.
The document discusses implementing an Entity-Attribute-Value (EAV) pattern for ActiveRecord models. It describes saving entity types as strings in an entity table, keeping attributes directly in the model, and using a polymorphic association between the entity and value. The implementation creates tables for each attribute type (string, integer, float, boolean), generates attribute models, and adds getter/setter methods to the entity model to access attribute values. It also discusses more advanced functionality like querying, ordering, and selecting specific attributes.
Designing REST API automation tests in KotlinDmitriy Sobko
The document discusses designing REST API automation tests in Kotlin. It covers microservices architecture, REST APIs, backend testing principles, the Kotlin programming language, Cucumber BDD framework, Spring Boot framework, and how to combine these tools for testing. The goals are to create tests that are stable, resistant to code changes, fast, extensible, and easily supported.
Deep Dive Into Swift - Presented at Coffee@DBG
In the previous month, Coffe@DBG Covered the basics of Swift, Apple's new programming language. This session introduces some of handpicked interesting features of Swift.
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
This is a talk I gave at the spring 2013 AngleBrackets/DevIntersection conference in Las Vegas.
HTML5 is all the rage these days but where do you look to find robust examples of using it along with jQuery, client-side templates, Ajax calls, data access technologies, and more? In this session, Dan Wahlin will walk through an application that demonstrates how key HTML5 technologies can be integrated and used to present data to users in different ways. Topics covered include exposing data to the client using RESTful services created using the new ASP.NET Web API, using Handlebars templates to render data, JavaScript techniques for structuring code, the role of HTML5 semantic tags, as well as how technologies such as the canvas, SVG, and video can be used. If you want to learn server-side as well as client-side techniques and strategies then this session is for you.
Similar to Introducing the ZIO DynamoDB Type Safe API (20)
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
4. Talk Outline
quick recap on using the AWS Java SDK
where we got up to in last years presentation - what was missing?
quick tour of the low level API
introduction to the new Type-safe API
show examples using the new API
summary and wrap up
4 / 68
6. AWS SDK example
final case class Student(
email: String, // partition key
enrollmentDate: Option[Instant],
payment: Payment
)
sealed trait Payment
object Payment {
final case object DebitCard extends Payment
final case object CreditCard extends Payment
final case object PayPal extends Payment
}
creates a Student DynamoDB table
serialises above model to the DynamoDB taking into account
optional fields
sum types
integrates with AWS Java SDK and does Java interop
does batched writes and reads
...what does the code look like?...
6 / 68
10. ZIO DynamoDB solution
val liveDynamoDBExecutorLayer = ...
val errorOrListOfStudent = (for {
avi = Student("avi@gmail.com", "maths", ...)
adam = Student("adam@gmail.com", "english", ...)
_ <- (put("student", avi) zip put("student", adam)).execute
listOfErrorOrStudent <- forEach(List(avi, adam)) { st =>
get[Student]("student",
PrimaryKey("email" -> st.email, "subject" -> st.subject)
)}.execute
} yield EitherUtil.collectAll(listOfErrorOrStudent))
.provideLayer(liveDynamoDBExecutorLayer)
10 / 68
11. Tour of Low Level API
AttributeValue's
ProjectionExpressions's
ConditionExpressions's
UpdateExpressions's
11 / 68
12. AttributeValue
An AttributeValue is DynamoDB type and value pair that is stored in the
database
sealed trait AttributeValue
final case class Binary(value: Iterable[Byte]) extends AttributeValue
final case class BinarySet(value: Iterable[Iterable[Byte]]) extends AttributeValue
final case class Bool(value: Boolean) extends AttributeValue
// ... etc etc
final case class String(value: ScalaString) extends AttributeValue
final case class Number(value: BigDecimal) extends AttributeValue
12 / 68
13. Item (AttrMap)
A DynamoDB Item is record - a map of field name to AttributeValue. In the
low level API it is modelled as an AttrMap
final case class AttrMap(map: Map[String, AttributeValue])
type Item = AttrMap
type PrimaryKey = AttrMap
val aviItem1 = AttrMap(Map("email" -> AttributeValue.String("email"),
"age" -> AttributeValue.Number(BigDecimal(21)))
// using an apply method that takes a type class
val aviItem2 = AttrMap("email" -> "avi@gmail.com", "age" -> 21)
val bool = aviItem1 == aviItem2 // true
13 / 68
15. ProjectionExpression
In DynamoDB a projection expression is a way of accessing the attribute
email
address.line1
tutors[1].surname
In the API it is represented as a sealed trait
sealed trait ProjectionExpression {...}
final case class Root extends ProjectionExpression
final case class MapElement(...) extends ProjectionExpression
final case class ListElement(...) extends ProjectionExpression
15 / 68
16. $ function (type unsafe)
manually creating ProjectionExpression's using the constructors is painful
ListElement(MapElement(MapElement(Root("foo"), "bar"), "baz"), 9) === 42
16 / 68
17. $ function (type unsafe)
manually creating ProjectionExpression's using the constructors is painful
ListElement(MapElement(MapElement(Root("foo"), "bar"), "baz"), 9) === 42
so we introduced the $ function
$("foo.bar.baz") === 42 && $("students[0].firstname") === "Avi"
17 / 68
18. $ function (type unsafe)
manually creating ProjectionExpression's using the constructors is painful
ListElement(MapElement(MapElement(Root("foo"), "bar"), "baz"), 9) === 42
so we introduced the $ function
$("foo.bar.baz") === 42 && $("students[0].firstname") === "Avi"
which is really convenient but totally type unsafe
18 / 68
19. Condition and Filter Expressions
In DynamoDB a condition expression is a way specifying a condition that must
hold for a PutItem, UpdateItem, or DeleteItem
A very similar concept is a filter expression that applies to a DynamoDB Query
In ZIO DynamoDB both Condition and Filter expressions concepts are modelled
by:
sealed trait ConditionExpression{...}
19 / 68
22. Example of Low Level API
val avi = AttrMap("email" -> "avi@a.com", "payment" -> "DebitCard", "age" -> 42)
val adam = AttrMap("email" -> "adam@a.com", "payment" -> "DebitCard", "age" -> 21)
22 / 68
23. Example of Low Level API
val avi = AttrMap("email" -> "avi@a.com", "payment" -> "DebitCard", "age" -> 42)
val adam = AttrMap("email" -> "adam@a.com", "payment" -> "DebitCard", "age" -> 21)
private val program = for {
_ <- (putItem("student", avi) zip putItem("student", adam)).execute
} yield ()
23 / 68
24. Example of Low Level API
val avi = AttrMap("email" -> "avi@a.com", "payment" -> "DebitCard", "age" -> 42)
val adam = AttrMap("email" -> "adam@a.com", "payment" -> "DebitCard", "age" -> 21)
private val program = for {
_ <- (putItem("student", avi) zip putItem("student", adam)).execute
item <- getItem("student", PrimaryKey("email" -> "avi@a.com")).execute
} yield ()
24 / 68
25. Example of Low Level API
val avi = AttrMap("email" -> "avi@a.com", "payment" -> "DebitCard", "age" -> 42)
val adam = AttrMap("email" -> "adam@a.com", "payment" -> "DebitCard", "age" -> 21)
private val program = for {
_ <- (putItem("student", avi) zip putItem("student", adam)).execute
item <- getItem("student", PrimaryKey("email" -> "avi@a.com")).execute
_ <- updateItem("student", PrimaryKey("email" -> "avi@a.com")){
$("payment").set("Paypal") + $("age").add(1)
}.execute
} yield ()
25 / 68
26. Example of Low Level API
val avi = AttrMap("email" -> "avi@a.com", "payment" -> "DebitCard", "age" -> 42)
val adam = AttrMap("email" -> "adam@a.com", "payment" -> "DebitCard", "age" -> 21)
private val program = for {
_ <- (putItem("student", avi) zip putItem("student", adam)).execute
item <- getItem("student", PrimaryKey("email" -> "avi@a.com")).execute
_ <- updateItem("student", PrimaryKey("email" -> "avi@a.com")) {
$("payment").set("Paypal") + $("age").add(1)
}
_ <- deleteItem("student", PrimaryKey("email" -> "avi@a.com")).where(
$("payment") === "Paypal" && $("age") > 21
).execute
} yield ()
26 / 68
27. Overview of Low Level APIs - Example
val avi = AttrMap("email" -> "avi@a.com", "payment" -> "DebitCard", "age" -> 42)
val adam = AttrMap("email" -> "adam@a.com", "payment" -> "DebitCard", "age" -> 21)
private val program = for {
_ <- (putItem("student", avi) zip putItem("student", adam)).execute
item <- getItem("student", PrimaryKey("email" -> "a@b.com")).execute
_ <- updateItem("student", PrimaryKey("email" -> "a@b.com")){
$("payment").set("Paypal") + $("age").add(1)
}
_ <- deleteItem("student", PrimaryKey("email" -> "a@b.com")).where(
$("payment") === "Paypal" && $("age") > 21
).execute
student: Student = tediousCustomDeSerialisationCode(item)
} yield student
27 / 68
28. Type Safe Serialisation API using ZIO Schema
ZIO Schema
"Compositional, type-safe schema definitions, which enable auto-
derivation of codecs and migrations."
28 / 68
29. Type Safe Serialisation API using ZIO Schema
final case class Student(email: String, subject: String, age: Int)
object Student {
implicit lazy val schema: Schema[Student] = DeriveSchema.gen[Student]
}
val avi = Student("avi@gmail.com", "maths", 21)
val adam = Student("adam@gmail.com", "english", 21)
29 / 68
30. Type Safe Serialisation API using ZIO Schema
object Student {
implicit lazy val schema: Schema[Student] = DeriveSchema.gen[Student]
}
val avi = Student("avi@gmail.com", "maths", 21)
val adam = Student("adam@gmail.com", "english", 21)
private val program = (for {
_ <- (put("student", avi) zip put("student", adam)).execute
student <- get("student", primaryKey("avi@gmail.com", "maths"))
.execute.right
} yield student == avi /* true */ )
type classes to derive codecs for serialisation to DynamoDB for put and
get
note that we are serialising case class directly
this is a huge increase in usability!
30 / 68
31. Codec customisations using annotations
annotations for cutomising
tagged union vs discrimated union
enum storage
names
case class
case class fields
discriminator field
enum values
31 / 68
32. Where we left off in the last talk
val avi: Student = get("student", primaryKey)
put[Student]("student", Student("avi@gmail.com", ...),...)
.where( $("addr.line1").contains("street") && $("addr.line2").beginsWith("f") )
updateItem("student", primaryKey) {
$("firstname").set("Avinder") +
$("groups").appendList(Chunk("group1"))
}.where( $("email") === "avi@gmail.com" )
deleteItem("student", primaryKey)
.where( $("age") > "18" && $("email") === "avi@gmail.com") )
querySomeItem("tableName1", limit = 10, $("email"), $("payment"), $("age"))
.sortOrder(ascending = false)
.whereKey(PartitionKey("email") === "avi@gmail.com")
.filter( $("age") > 21 && $("subject").beginsWith("Math") )
Can you spot the run time error problem in the above code?
32 / 68
36. Optics
Provide a way of navigating your immutable data structure that reduces
boilerplate
Prism - access product data
Lens - access sum type data
Traversal - access a collection
Drilling down into a field eg Student.email is a Scala language feature that is
not a value
Optics libraries take these language features and turn them into values that
can be composed
Typically libraries use use functions in the encoding (executable encoding)
36 / 68
37. Reified Optics
sealed trait Payment
object Payment {
final case object DebitCard extends Payment
// ...
implicit val schema = DeriveSchema.gen[Payment]
}
final case class Student(
email: String, // partition key
enrollDate: Instant,
payment: Payment
)
object Student {
implicit val schema = DeriveSchema.gen[Student]
val (email, enrollDate, payment) = ProjectionExpression.accessors[Student]
}
37 / 68
38. Reified Optics
Reified optics are not enough on their own - we needed extend this type safety
to the rest of the API
so we added phantom type parameters to our lower level representations:
sealed trait ProjectionExpression[-From,
+To]
sealed trait ConditionExpression[-From]
38 / 68
39. New type safe API
the new type safe API uses reified optics to constrain expressions to the
type we are working with
39 / 68
40. New type safe API - Update Expressions
val student = Student(...)
object Student {
val (email, enrollDate, payment, age) = ProjectionExpression.accessors[Student]
}
The update expressions here are typesafe.
40 / 68
41. New type safe API - Condition Expressions
val student = Student(...)
object Student {
val (email, enrollDate, payment, age) = ProjectionExpression.accessors[Student]
}
41 / 68
42. New type safe API - delete condition expressions
val student = Student(...)
object Student {
val (email, enrollDate, payment, age) = ProjectionExpression.accessors[Student]
}
Elephant injection attack will not work!
42 / 68
46. Optimistic locking example
final case class Student(email: String, payment: Payment, age: Int,
version: Long = 0)
object Student {
implicit val schema = DeriveSchema.gen[Student]
val (email, payment, age, version) = ProjectionExpression.accessors[Student]
}
46 / 68
47. Optimistic locking example
final case class Student(email: String, payment: Payment, age: Int,
version: Long = 0)
object Student {
implicit val schema = DeriveSchema.gen[Student]
val (email, payment, age, version) = ProjectionExpression.accessors[Student]
}
def optimisticUpdate(primaryKey: PrimaryKey)(f: Student => Action[Student]) = ???
47 / 68
48. Optimistic locking example
final case class Student(email: String, payment: Payment, age: Int,
version: Long = 0)
object Student {
implicit val schema = DeriveSchema.gen[Student]
val (email, payment, age, version) = ProjectionExpression.accessors[Student]
}
def optimisticUpdate(primaryKey: PrimaryKey)(f: Student => Action[Student]) =
for {
before <- get[Student]("student", primaryKey).execute.absolve
} yield ()
48 / 68
49. Optimistic locking example
final case class Student(email: String, payment: Payment, age: Int,
version: Long = 0)
object Student {
implicit val schema = DeriveSchema.gen[Student]
val (email, payment, age, version) = ProjectionExpression.accessors[Student]
}
def optimisticUpdate(primaryKey: PrimaryKey)(f: Student => Action[Student]) =
for {
before <- get[Student]("student", primaryKey).execute.absolve
_ <- update[Student]("student", primaryKey) { ... }.execute
} yield ()
49 / 68
50. Optimistic locking example
final case class Student(email: String, payment: Payment, age: Int,
version: Long = 0)
object Student {
implicit val schema = DeriveSchema.gen[Student]
val (email, payment, age, version) = ProjectionExpression.accessors[Student]
}
def optimisticUpdate(primaryKey: PrimaryKey)(f: Student => Action[Student]) =
for {
before <- get[Student]("student", primaryKey).execute.absolve
_ <- update[Student]("student", primaryKey) {
f(before) + version.add(1)
} ...
} yield ()
50 / 68
51. Optimistic locking example
final case class Student(email: String, payment: Payment, age: Int,
version: Long = 0)
object Student {
implicit val schema = DeriveSchema.gen[Student]
val (email, payment, age, version) = ProjectionExpression.accessors[Student]
}
def optimisticUpdate(primaryKey: PrimaryKey)(f: Student => Action[Student]) =
for {
before <- get[Student]("student", primaryKey).execute.absolve
_ <- update[Student]("student", primaryKey) {
f(before) + version.add(1)
}.where(Student.version === before.version).execute.retry(policy)
} yield ()
51 / 68
52. Optimistic locking example
final case class Student(email: String, payment: Payment, age: Int,
version: Long = 0)
object Student {
implicit val schema = DeriveSchema.gen[Student]
val (email, payment, age, version) = ProjectionExpression.accessors[Student]
}
def optimisticUpdate(primaryKey: PrimaryKey)(f: Student => Action[Student]) =
for {
before <- get[Student]("student", primaryKey).execute.absolve
_ <- update[Student]("student", primaryKey) {
f(before) + version.add(1)
}.where(Student.version === before.version).execute.retry(policy)
} yield ()
for {
_ <- optimisticUpdate(primaryKey("avi@gmail.com", "maths")) { student =>
if (student.age > 42)
Student.payment.set(Payment.DebitCard)
else
Student.payment.set(Payment.CreditCard)
}.execute
} yield ()
52 / 68
53. Example 2 - Migration Pipeline Example
53 / 68
54. Migration Pipeline Example
final case class Student(
email: String, // partition key
age: Int,
enrollmentDate: Instant,
payment: Payment
)
final case class StudentCourses(
email: String,
courses: Set[String]
)
final case class Student2(
email: String, // partition key
age: Int,
enrollmentDate: Instant,
payment: Payment,
courses: Set[String]
)
54 / 68
55. Migration Pipeline Example
final case class Student(
email: String, // partition key
age: Int,
enrollmentDate: Instant,
payment: Payment
)
final case class StudentCourses(
email: String,
courses: Set[String]
)
final case class Student2(
email: String, // partition key
age: Int,
enrollmentDate: Instant,
payment: Payment,
courses: Set[String]
)
55 / 68
56. Migration Pipeline Example
final case class Student(
email: String, // partition key
age: Int,
enrollmentDate: Instant,
payment: Payment
)
final case class StudentCourses(
email: String,
courses: Set[String]
)
final case class Student2(
email: String, // partition key
age: Int,
enrollmentDate: Instant,
payment: Payment,
courses: Set[String]
)
56 / 68
57. Migration Pipeline Example
private val program = for {
students <- scanAll[Student](tableName = "s")
.parallel(16)
.filter(Student.age > 21 && Student.enrollmentDate > aDate)
.execute
studentsAndCourses =
batchReadFromStream[...]("sc", students)(s => PrimaryKey("email" -> s.email))
_ <- batchWriteFromStream(studentsAndCourses) {
case (s, sc) => put(tableName = "Students2",
Student2(s.email, s.age, s.enrollmentDate, s.payment, sc.courses)
)
}.runDrain
} yield ()
57 / 68
58. Migration Pipeline Example
private val program = for {
students <- scanAll[Student](tableName = "s")
.parallel(16)
.filter(Student.age > 21 && Student.enrollmentDate > aDate)
.execute
studentsAndCourses =
batchReadFromStream[...]("sc", students)(s => PrimaryKey("email" -> s.email))
_ <- batchWriteFromStream(studentsAndCourses) {
case (s, sc) => put(tableName = "Students2",
Student2(s.email, s.age, s.enrollmentDate, s.payment, sc.courses)
)
}.runDrain
} yield ()
58 / 68
59. Migration Pipeline Example
private val program = for {
students <- scanAll[Student](tableName = "s")
.parallel(16)
.filter(Student.age > 21 && Student.enrollmentDate > aDate)
.execute
studentsAndCourses: ZStream[..., (Student, StudentCourses)] =
batchReadFromStream[...]("sc", students)(s => PrimaryKey("email" -> s.email))
_ <- batchWriteFromStream(studentsAndCourses) {
case (s, sc) => put(tableName = "Students2",
Student2(s.email, s.age, s.enrollmentDate, s.payment, sc.courses)
)
}.runDrain
} yield ()
59 / 68
60. Migration Pipeline Example
private val program = for {
students <- scanAll[Student](tableName = "s")
.parallel(16)
.filter(Student.age > 21 && Student.enrollmentDate > aDate)
.execute
studentsAndCourses: ZStream[..., (Student, StudentCourses)] =
batchReadFromStream[...]("sc", students)(s => PrimaryKey("email" -> s.email))
_ <- batchWriteFromStream(studentsAndCourses) {
case (s, sc) => put(tableName = "Students2",
Student2(s.email, s.age, s.enrollmentDate, s.payment, sc.courses)
)
}.runDrain
} yield ()
60 / 68
67. Learning More
github repo https://github.com/zio/zio-dynamodb
microsite https://zio.github.io/zio-dynamodb/
examples in own sbt module zio-dynamodb/examples
integration tests dynamodb/src/it/scala/zio/dynamodb/
last years talk introducing ZIO DynamoDB at Functional Scala 2021
67 / 68
68. Thanks
a big thank you to:
all the sponsors Ziverge, Scalac, UMATR, Coralogix, Conducktor,
Matechs for giving me this opportunity to talk about this library
Sandra and Agata for organising the conference
John for his mentorship during development
68 / 68