In this session, I will discuss some of the practical uses of JSON in MySQL, focusing on version 5.7 but also discussing options for previous versions, and briefly discussing MySQL 8.0. I will discuss several specific use cases, as well as some JSON antipatterns that should be avoided.
Some topics I will address:
- The evolution of JSON parsing in MySQL: from stored routines to UDFs to native functions
- Real-life use cases: Custom fields, flexible rollups, nested objects, etc.
- The power of JSON + virtual columns
- Storing JSON as text versus using new JSON data types
- Read/write balance considerations
- Disk storage implications
- Indexing JSON documents in MySQL
- Additional JSON features in MySQL 8.0
Red-black trees are self-balancing binary search trees. They guarantee an O(log n) running time for operations by ensuring that no path from the root to a leaf is more than twice as long as any other. Nodes are colored red or black, and properties of the coloring are designed to keep the tree balanced. Inserting and deleting nodes may violate these properties, so rotations are used to restore the red-black properties and balance of the tree.
Flutter is an open source framework that allows developers to build high-quality, high-performance mobile apps for Android and iOS using a single codebase written in Dart. It provides reusable widgets and supports features like hot reload for fast development. Flutter's advantages include single codebase for multiple platforms, high performance, and beautiful UI widgets. Its disadvantages are needing to learn a new language (Dart) and mixing of logic and UI. Dart is an object-oriented language used in Flutter that supports concepts like classes, objects, inheritance and polymorphism.
Apache Drill is an open source SQL query engine for analyzing data in non-relational data stores like HDFS, HBase, MongoDB, and others. It allows users to query data across these systems using SQL without requiring schemas or transformation of the data. Drill uses a JSON data model and columnar storage to provide fast performance on large datasets. It is optimized to work across distributed systems and enables analysis of complex nested and hierarchical data.
This document discusses Apache Drill, an open source SQL query engine for analyzing data in non-relational data stores like JSON, CSV, and Hadoop data formats. It provides an overview of Drill's key features such as its ability to query diverse data sources with a simple SQL interface without requiring schemas, its SQL-on-Everything model, high performance through columnar storage and execution, and its ability to scale from a single machine to large clusters. The document also demonstrates how to install Drill, configure data sources, and run queries against sample Yelp data to analyze reviews, users, and businesses.
Beyond PHP - It's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Introduction to MongoDB
MongoDB Database
Document Model
BSON
Data Model
CRUD operations
High Availability and Scalability
Replication
Sharding
Hands-On MongoDB
Beyond php - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Beyond php - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Red-black trees are self-balancing binary search trees. They guarantee an O(log n) running time for operations by ensuring that no path from the root to a leaf is more than twice as long as any other. Nodes are colored red or black, and properties of the coloring are designed to keep the tree balanced. Inserting and deleting nodes may violate these properties, so rotations are used to restore the red-black properties and balance of the tree.
Flutter is an open source framework that allows developers to build high-quality, high-performance mobile apps for Android and iOS using a single codebase written in Dart. It provides reusable widgets and supports features like hot reload for fast development. Flutter's advantages include single codebase for multiple platforms, high performance, and beautiful UI widgets. Its disadvantages are needing to learn a new language (Dart) and mixing of logic and UI. Dart is an object-oriented language used in Flutter that supports concepts like classes, objects, inheritance and polymorphism.
Apache Drill is an open source SQL query engine for analyzing data in non-relational data stores like HDFS, HBase, MongoDB, and others. It allows users to query data across these systems using SQL without requiring schemas or transformation of the data. Drill uses a JSON data model and columnar storage to provide fast performance on large datasets. It is optimized to work across distributed systems and enables analysis of complex nested and hierarchical data.
This document discusses Apache Drill, an open source SQL query engine for analyzing data in non-relational data stores like JSON, CSV, and Hadoop data formats. It provides an overview of Drill's key features such as its ability to query diverse data sources with a simple SQL interface without requiring schemas, its SQL-on-Everything model, high performance through columnar storage and execution, and its ability to scale from a single machine to large clusters. The document also demonstrates how to install Drill, configure data sources, and run queries against sample Yelp data to analyze reviews, users, and businesses.
Beyond PHP - It's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Introduction to MongoDB
MongoDB Database
Document Model
BSON
Data Model
CRUD operations
High Availability and Scalability
Replication
Sharding
Hands-On MongoDB
Beyond php - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Beyond php - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Beyond php - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy NguyenHuy Nguyen
This document outlines Viki's analytics infrastructure, including data collection, storage, processing, and visualization. It discusses collecting behavioral data from various sources and storing it in Hadoop. Data is centralized, cleaned, transformed, and loaded into a PostgreSQL data warehouse for analysis. Real-time data is processed using Apache Storm and visualized on dashboards and alerts. Technologies used include Ruby, Python, Java, Hadoop, Hive, and Amazon Redshift for analytics and PostgreSQL, MongoDB, and Redis for transactional data.
OrientDB is a multi-model NoSQL document database that provides both graph and document structures and queries. It supports ACID transactions, schema-full and schema-less modes, HTTP/binary protocols, and allows both SQL-like and native graph queries. OrientDB provides APIs for Java, JRuby and other languages to interface with the database.
MySQL 5.7 Tutorial Dutch PHP Conference 2015Dave Stokes
MySQL 5.7 is the latest version of the MySQL database. It includes new features such as support for JSON as a native data type with functions for manipulating JSON documents. Security has also been improved with secure defaults, password rotation/expiration controls, and SSL encryption enabled by default for the C client library. The release candidate for 5.7 was released in April 2015 and includes patches, contributions, and enhancements over previous versions.
MySQL 5.7. Tutorial - Dutch PHP Conference 2015Dave Stokes
MySQL 5.7 is the latest version of the MySQL database. It includes new features such as support for JSON as a native data type with functions for manipulating JSON documents. Security has also been improved with secure defaults, password rotation/expiration controls, and SSL encryption enabled by default for the C client library. The release candidate for 5.7 was released in April 2015 and includes patches, contributions, and enhancements over previous versions.
Wszyscy zostaliśmy oszukani! Automatyczne zarządzanie pamięci rozwiąże wszystkie Wasze problemy, mówili. W zarządzanych środowiskach takich jak CLR JVM nie będzie wycieków pamięci, mówili! Właściwie pamięć jest tania i nie musisz się już nią nigdy więcej martwić. Wszyscy kłamali. Automatyczne zarządzanie pamięcią jest wygodną abstrakcją i bardzo często działa dobrze. Ale jak każda abstrakcja, wcześniej czy później "wycieka" ona. I to najczęściej w najmniej spodziewanym i przyjemnym momencie. W tej sesji spróbuję otworzyć oczy na fakt, że błoga nieświadomość nt. tej abstrakcji może być kosztowna. Pokażę jak może się objawić frywolne traktowanie pamięci i co możemy zyskać pisząc kod zdając sobie sprawę, że pamięć jednak nie jest nieskończona, tania i zawsze jednakowo szybka.
This document discusses MySQL's support for both SQL and NoSQL through its MySQL Document Store feature. It provides an overview of how MySQL 8.0 allows users to store JSON documents and access them through either SQL queries or NoSQL CRUD APIs. This hybrid model provides the flexibility of NoSQL with the reliability of SQL in a single database, meeting the needs of modern applications that require both relational and non-relational data storage and access.
Beyond php - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
This document discusses the rise of JSON usage in relational database management systems (RDBMS). It provides an overview of JSON and its benefits as a lightweight data format. It then examines different approaches to storing and querying JSON data in an RDBMS, including using JSON columns, entity-attribute-value modeling, and document-oriented modeling that treats documents as records. The document discusses pros and cons of each approach and emphasizes the importance of good data modeling and structure. It also shows examples of using JSON functions and indexing in MySQL.
- IOOF uses MongoDB for state management in over 85% of its 250+ microservices due to its document storage, developer friendliness, performance at scale, and ability to break from monolithic database architectures.
- IOOF's data warehouse also utilizes MongoDB to store time series data from various microservices via change data capture (CDC) for improved analytics over relational databases.
- IOOF has three MongoDB replica sets for production, staging, and development environments, handling high read/write volumes through sharding and partitioning as needed for scale.
Beyond php it's not (just) about the codeWim Godden
The document discusses database queries and optimization. It begins with an example of a complex database query and explains how to detect problematic queries using tools like slow query log and pt-query-digest. It then discusses indexing strategies and when to use indexes. The document also describes a case study of a client's jobs search site that was experiencing high database load due to inefficient queries in a loop, and how batching the queries into a single query solved the problem.
How to process data using events on top of PHP and MongoDB. Introducing Eventsourcing and CQRS, how to handle events and how to generate Read Models and Aggregates leveraging the MongoDB Aggregation Framework.
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB
Asya is back, and so is Sherlock Holmes and his techniques to gather and analyze data from your poorly performing MongoDB clusters. In this advanced talk we take a deep look at all the diagnostic data that lives inside MongoDB - how to interrogate and interpret it to help you solve those frustrating performance bottlenecks that we all face occasionally.
NoSQL Deepdive - with Informix NoSQL. IOD 2013Keshav Murthy
Deepdive into IBM Informix NoSQL with Mongodb API, hybrid access. Informix now supports MongoDB API and stores JSON natively, thus supporting flexible schema. Informix NoSQL also supports sharding, enabling scale out. This presentation gives overview to a real application to technical details of this
Postgres Conference (PgCon) New York 2019Ibrar Ahmed
PostgreSQL provides a way to communicate with external data sources. This could be another PostgreSQL instance or any other database. The other database might be a relational database such as MySQL or Oracle; or any NoSQL database such as MongoDB or Hadoop. To achieve this, PostgreSQL implements ISO Standard call SQL-MED in the form of Foreign Data Wrappers (FDW). This presentation will explain in detail how PostgreSQL FDWs work. It will include a detailed explanation of simple features and will introduce more advanced features that were added in recent versions of PostgreSQL. Examples of these would be to show how aggregate pushdown and join pushdown work in PostgreSQL. The talk will include working examples of these advanced features and demonstrating their use with different databases. These examples show how data from different database flavors can be used by PostgreSQL, including those from heterogeneous relational databases, and showing NoSQL column store joins.
Beyond Breakpoints: A Tour of Dynamic AnalysisC4Media
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/2dXUUTG.
Nathan Taylor provides an introduction to the dynamic analysis research space, suggesting integrating these techniques into various internal tools. Filmed at qconnewyork.com.
Nathan Taylor is a software developer currently employed at Fastly, where he works on making the Web faster through high performance content delivery. Previous gigs have included hacking on low-level systems software such as Java runtimes at Twitter and, prior to that, the Xen virtual machine monitor in grad school.
Beyond PHP - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just writing PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...Skilld
Build tons of multi-device JavaScript applications
Part 1 : Boilerplate, design patterns & MVC(C), high performance UI
by Jean-Baptiste Guerraz & Igor Uzlov & UA Web Forum Kiyv 2014
This document summarizes a presentation about using JSON in MySQL 5.7. It discusses the history of JSON support in MySQL from storing JSON as text to native JSON functions. It provides examples of using JSON functions like JSON_EXTRACT and JSON_SEARCH. It also presents three use cases for JSON in MySQL: flexible rollups of event data, storing configuration data, and addressing the EAV (Entity-Attribute-Value) antipattern.
Google BigQuery is a big data analytics service that allows users to analyze petabytes of data using SQL queries. It offers features like fast query response times, SQL-like queries, multi-dataset support, and pay-as-you-go pricing. The document provides an overview of BigQuery and demonstrates how to import and query data from the BigQuery web UI, command line, and programmatically using Node.js and Google Apps Script.
Dandelion Hashtable: beyond billion requests per second on a commodity serverAntonios Katsarakis
This slide deck presents DLHT, a concurrent in-memory hashtable. Despite efforts to optimize hashtables, that go as far as sacrificing core functionality, state-of-the-art designs still incur multiple memory accesses per request and block request processing in three cases. First, most hashtables block while waiting for data to be retrieved from memory. Second, open-addressing designs, which represent the current state-of-the-art, either cannot free index slots on deletes or must block all requests to do so. Third, index resizes block every request until all objects are copied to the new index. Defying folklore wisdom, DLHT forgoes open-addressing and adopts a fully-featured and memory-aware closed-addressing design based on bounded cache-line-chaining. This design offers lock-free index operations and deletes that free slots instantly, (2) completes most requests with a single memory access, (3) utilizes software prefetching to hide memory latencies, and (4) employs a novel non-blocking and parallel resizing. In a commodity server and a memory-resident workload, DLHT surpasses 1.6B requests per second and provides 3.5x (12x) the throughput of the state-of-the-art closed-addressing (open-addressing) resizable hashtable on Gets (Deletes).
The Department of Veteran Affairs (VA) invited Taylor Paschal, Knowledge & Information Management Consultant at Enterprise Knowledge, to speak at a Knowledge Management Lunch and Learn hosted on June 12, 2024. All Office of Administration staff were invited to attend and received professional development credit for participating in the voluntary event.
The objectives of the Lunch and Learn presentation were to:
- Review what KM ‘is’ and ‘isn’t’
- Understand the value of KM and the benefits of engaging
- Define and reflect on your “what’s in it for me?”
- Share actionable ways you can participate in Knowledge - - Capture & Transfer
Beyond php - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Grokking Engineering - Data Analytics Infrastructure at Viki - Huy NguyenHuy Nguyen
This document outlines Viki's analytics infrastructure, including data collection, storage, processing, and visualization. It discusses collecting behavioral data from various sources and storing it in Hadoop. Data is centralized, cleaned, transformed, and loaded into a PostgreSQL data warehouse for analysis. Real-time data is processed using Apache Storm and visualized on dashboards and alerts. Technologies used include Ruby, Python, Java, Hadoop, Hive, and Amazon Redshift for analytics and PostgreSQL, MongoDB, and Redis for transactional data.
OrientDB is a multi-model NoSQL document database that provides both graph and document structures and queries. It supports ACID transactions, schema-full and schema-less modes, HTTP/binary protocols, and allows both SQL-like and native graph queries. OrientDB provides APIs for Java, JRuby and other languages to interface with the database.
MySQL 5.7 Tutorial Dutch PHP Conference 2015Dave Stokes
MySQL 5.7 is the latest version of the MySQL database. It includes new features such as support for JSON as a native data type with functions for manipulating JSON documents. Security has also been improved with secure defaults, password rotation/expiration controls, and SSL encryption enabled by default for the C client library. The release candidate for 5.7 was released in April 2015 and includes patches, contributions, and enhancements over previous versions.
MySQL 5.7. Tutorial - Dutch PHP Conference 2015Dave Stokes
MySQL 5.7 is the latest version of the MySQL database. It includes new features such as support for JSON as a native data type with functions for manipulating JSON documents. Security has also been improved with secure defaults, password rotation/expiration controls, and SSL encryption enabled by default for the C client library. The release candidate for 5.7 was released in April 2015 and includes patches, contributions, and enhancements over previous versions.
Wszyscy zostaliśmy oszukani! Automatyczne zarządzanie pamięci rozwiąże wszystkie Wasze problemy, mówili. W zarządzanych środowiskach takich jak CLR JVM nie będzie wycieków pamięci, mówili! Właściwie pamięć jest tania i nie musisz się już nią nigdy więcej martwić. Wszyscy kłamali. Automatyczne zarządzanie pamięcią jest wygodną abstrakcją i bardzo często działa dobrze. Ale jak każda abstrakcja, wcześniej czy później "wycieka" ona. I to najczęściej w najmniej spodziewanym i przyjemnym momencie. W tej sesji spróbuję otworzyć oczy na fakt, że błoga nieświadomość nt. tej abstrakcji może być kosztowna. Pokażę jak może się objawić frywolne traktowanie pamięci i co możemy zyskać pisząc kod zdając sobie sprawę, że pamięć jednak nie jest nieskończona, tania i zawsze jednakowo szybka.
This document discusses MySQL's support for both SQL and NoSQL through its MySQL Document Store feature. It provides an overview of how MySQL 8.0 allows users to store JSON documents and access them through either SQL queries or NoSQL CRUD APIs. This hybrid model provides the flexibility of NoSQL with the reliability of SQL in a single database, meeting the needs of modern applications that require both relational and non-relational data storage and access.
Beyond php - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just wrting PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
This document discusses the rise of JSON usage in relational database management systems (RDBMS). It provides an overview of JSON and its benefits as a lightweight data format. It then examines different approaches to storing and querying JSON data in an RDBMS, including using JSON columns, entity-attribute-value modeling, and document-oriented modeling that treats documents as records. The document discusses pros and cons of each approach and emphasizes the importance of good data modeling and structure. It also shows examples of using JSON functions and indexing in MySQL.
- IOOF uses MongoDB for state management in over 85% of its 250+ microservices due to its document storage, developer friendliness, performance at scale, and ability to break from monolithic database architectures.
- IOOF's data warehouse also utilizes MongoDB to store time series data from various microservices via change data capture (CDC) for improved analytics over relational databases.
- IOOF has three MongoDB replica sets for production, staging, and development environments, handling high read/write volumes through sharding and partitioning as needed for scale.
Beyond php it's not (just) about the codeWim Godden
The document discusses database queries and optimization. It begins with an example of a complex database query and explains how to detect problematic queries using tools like slow query log and pt-query-digest. It then discusses indexing strategies and when to use indexes. The document also describes a case study of a client's jobs search site that was experiencing high database load due to inefficient queries in a loop, and how batching the queries into a single query solved the problem.
How to process data using events on top of PHP and MongoDB. Introducing Eventsourcing and CQRS, how to handle events and how to generate Read Models and Aggregates leveraging the MongoDB Aggregation Framework.
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB
Asya is back, and so is Sherlock Holmes and his techniques to gather and analyze data from your poorly performing MongoDB clusters. In this advanced talk we take a deep look at all the diagnostic data that lives inside MongoDB - how to interrogate and interpret it to help you solve those frustrating performance bottlenecks that we all face occasionally.
NoSQL Deepdive - with Informix NoSQL. IOD 2013Keshav Murthy
Deepdive into IBM Informix NoSQL with Mongodb API, hybrid access. Informix now supports MongoDB API and stores JSON natively, thus supporting flexible schema. Informix NoSQL also supports sharding, enabling scale out. This presentation gives overview to a real application to technical details of this
Postgres Conference (PgCon) New York 2019Ibrar Ahmed
PostgreSQL provides a way to communicate with external data sources. This could be another PostgreSQL instance or any other database. The other database might be a relational database such as MySQL or Oracle; or any NoSQL database such as MongoDB or Hadoop. To achieve this, PostgreSQL implements ISO Standard call SQL-MED in the form of Foreign Data Wrappers (FDW). This presentation will explain in detail how PostgreSQL FDWs work. It will include a detailed explanation of simple features and will introduce more advanced features that were added in recent versions of PostgreSQL. Examples of these would be to show how aggregate pushdown and join pushdown work in PostgreSQL. The talk will include working examples of these advanced features and demonstrating their use with different databases. These examples show how data from different database flavors can be used by PostgreSQL, including those from heterogeneous relational databases, and showing NoSQL column store joins.
Beyond Breakpoints: A Tour of Dynamic AnalysisC4Media
Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/2dXUUTG.
Nathan Taylor provides an introduction to the dynamic analysis research space, suggesting integrating these techniques into various internal tools. Filmed at qconnewyork.com.
Nathan Taylor is a software developer currently employed at Fastly, where he works on making the Web faster through high performance content delivery. Previous gigs have included hacking on low-level systems software such as Java runtimes at Twitter and, prior to that, the Xen virtual machine monitor in grad school.
Beyond PHP - it's not (just) about the codeWim Godden
Most PHP developers focus on writing code. But creating Web applications is about much more than just writing PHP. Take a step outside the PHP cocoon and into the big PHP ecosphere to find out how small code changes can make a world of difference on servers and network. This talk is an eye-opener for developers who spend over 80% of their time coding, debugging and testing.
Build tons of multi-device JavaScript applications - Part 1 : Boilerplate, de...Skilld
Build tons of multi-device JavaScript applications
Part 1 : Boilerplate, design patterns & MVC(C), high performance UI
by Jean-Baptiste Guerraz & Igor Uzlov & UA Web Forum Kiyv 2014
This document summarizes a presentation about using JSON in MySQL 5.7. It discusses the history of JSON support in MySQL from storing JSON as text to native JSON functions. It provides examples of using JSON functions like JSON_EXTRACT and JSON_SEARCH. It also presents three use cases for JSON in MySQL: flexible rollups of event data, storing configuration data, and addressing the EAV (Entity-Attribute-Value) antipattern.
Google BigQuery is a big data analytics service that allows users to analyze petabytes of data using SQL queries. It offers features like fast query response times, SQL-like queries, multi-dataset support, and pay-as-you-go pricing. The document provides an overview of BigQuery and demonstrates how to import and query data from the BigQuery web UI, command line, and programmatically using Node.js and Google Apps Script.
Similar to Practical JSON in MySQL 5.7 and Beyond (20)
Dandelion Hashtable: beyond billion requests per second on a commodity serverAntonios Katsarakis
This slide deck presents DLHT, a concurrent in-memory hashtable. Despite efforts to optimize hashtables, that go as far as sacrificing core functionality, state-of-the-art designs still incur multiple memory accesses per request and block request processing in three cases. First, most hashtables block while waiting for data to be retrieved from memory. Second, open-addressing designs, which represent the current state-of-the-art, either cannot free index slots on deletes or must block all requests to do so. Third, index resizes block every request until all objects are copied to the new index. Defying folklore wisdom, DLHT forgoes open-addressing and adopts a fully-featured and memory-aware closed-addressing design based on bounded cache-line-chaining. This design offers lock-free index operations and deletes that free slots instantly, (2) completes most requests with a single memory access, (3) utilizes software prefetching to hide memory latencies, and (4) employs a novel non-blocking and parallel resizing. In a commodity server and a memory-resident workload, DLHT surpasses 1.6B requests per second and provides 3.5x (12x) the throughput of the state-of-the-art closed-addressing (open-addressing) resizable hashtable on Gets (Deletes).
The Department of Veteran Affairs (VA) invited Taylor Paschal, Knowledge & Information Management Consultant at Enterprise Knowledge, to speak at a Knowledge Management Lunch and Learn hosted on June 12, 2024. All Office of Administration staff were invited to attend and received professional development credit for participating in the voluntary event.
The objectives of the Lunch and Learn presentation were to:
- Review what KM ‘is’ and ‘isn’t’
- Understand the value of KM and the benefits of engaging
- Define and reflect on your “what’s in it for me?”
- Share actionable ways you can participate in Knowledge - - Capture & Transfer
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.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving
What began over 115 years ago as a supplier of precision gauges to the automotive industry has evolved into being an industry leader in the manufacture of product branding, automotive cockpit trim and decorative appliance trim. Value-added services include in-house Design, Engineering, Program Management, Test Lab and Tool Shops.
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyScyllaDB
Freshworks creates AI-boosted business software that helps employees work more efficiently and effectively. Managing data across multiple RDBMS and NoSQL databases was already a challenge at their current scale. To prepare for 10X growth, they knew it was time to rethink their database strategy. Learn how they architected a solution that would simplify scaling while keeping costs under control.
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsDianaGray10
Join us to learn how UiPath Apps can directly and easily interact with prebuilt connectors via Integration Service--including Salesforce, ServiceNow, Open GenAI, and more.
The best part is you can achieve this without building a custom workflow! Say goodbye to the hassle of using separate automations to call APIs. By seamlessly integrating within App Studio, you can now easily streamline your workflow, while gaining direct access to our Connector Catalog of popular applications.
We’ll discuss and demo the benefits of UiPath Apps and connectors including:
Creating a compelling user experience for any software, without the limitations of APIs.
Accelerating the app creation process, saving time and effort
Enjoying high-performance CRUD (create, read, update, delete) operations, for
seamless data management.
Speakers:
Russell Alfeche, Technology Leader, RPA at qBotic and UiPath MVP
Charlie Greenberg, host
"Scaling RAG Applications to serve millions of users", Kevin GoedeckeFwdays
How we managed to grow and scale a RAG application from zero to thousands of users in 7 months. Lessons from technical challenges around managing high load for LLMs, RAGs and Vector databases.
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...Alex Pruden
Folding is a recent technique for building efficient recursive SNARKs. Several elegant folding protocols have been proposed, such as Nova, Supernova, Hypernova, Protostar, and others. However, all of them rely on an additively homomorphic commitment scheme based on discrete log, and are therefore not post-quantum secure. In this work we present LatticeFold, the first lattice-based folding protocol based on the Module SIS problem. This folding protocol naturally leads to an efficient recursive lattice-based SNARK and an efficient PCD scheme. LatticeFold supports folding low-degree relations, such as R1CS, as well as high-degree relations, such as CCS. The key challenge is to construct a secure folding protocol that works with the Ajtai commitment scheme. The difficulty, is ensuring that extracted witnesses are low norm through many rounds of folding. We present a novel technique using the sumcheck protocol to ensure that extracted witnesses are always low norm no matter how many rounds of folding are used. Our evaluation of the final proof system suggests that it is as performant as Hypernova, while providing post-quantum security.
Paper Link: https://eprint.iacr.org/2024/257
From Natural Language to Structured Solr Queries using LLMsSease
This talk draws on experimentation to enable AI applications with Solr. One important use case is to use AI for better accessibility and discoverability of the data: while User eXperience techniques, lexical search improvements, and data harmonization can take organizations to a good level of accessibility, a structural (or “cognitive” gap) remains between the data user needs and the data producer constraints.
That is where AI – and most importantly, Natural Language Processing and Large Language Model techniques – could make a difference. This natural language, conversational engine could facilitate access and usage of the data leveraging the semantics of any data source.
The objective of the presentation is to propose a technical approach and a way forward to achieve this goal.
The key concept is to enable users to express their search queries in natural language, which the LLM then enriches, interprets, and translates into structured queries based on the Solr index’s metadata.
This approach leverages the LLM’s ability to understand the nuances of natural language and the structure of documents within Apache Solr.
The LLM acts as an intermediary agent, offering a transparent experience to users automatically and potentially uncovering relevant documents that conventional search methods might overlook. The presentation will include the results of this experimental work, lessons learned, best practices, and the scope of future work that should improve the approach and make it production-ready.
Discover top-tier mobile app development services, offering innovative solutions for iOS and Android. Enhance your business with custom, user-friendly mobile applications.
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving
Manufacturing custom quality metal nameplates and badges involves several standard operations. Processes include sheet prep, lithography, screening, coating, punch press and inspection. All decoration is completed in the flat sheet with adhesive and tooling operations following. The possibilities for creating unique durable nameplates are endless. How will you create your brand identity? We can help!
Must Know Postgres Extension for DBA and Developer during MigrationMydbops
Mydbops Opensource Database Meetup 16
Topic: Must-Know PostgreSQL Extensions for Developers and DBAs During Migration
Speaker: Deepak Mahto, Founder of DataCloudGaze Consulting
Date & Time: 8th June | 10 AM - 1 PM IST
Venue: Bangalore International Centre, Bangalore
Abstract: Discover how PostgreSQL extensions can be your secret weapon! This talk explores how key extensions enhance database capabilities and streamline the migration process for users moving from other relational databases like Oracle.
Key Takeaways:
* Learn about crucial extensions like oracle_fdw, pgtt, and pg_audit that ease migration complexities.
* Gain valuable strategies for implementing these extensions in PostgreSQL to achieve license freedom.
* Discover how these key extensions can empower both developers and DBAs during the migration process.
* Don't miss this chance to gain practical knowledge from an industry expert and stay updated on the latest open-source database trends.
Mydbops Managed Services specializes in taking the pain out of database management while optimizing performance. Since 2015, we have been providing top-notch support and assistance for the top three open-source databases: MySQL, MongoDB, and PostgreSQL.
Our team offers a wide range of services, including assistance, support, consulting, 24/7 operations, and expertise in all relevant technologies. We help organizations improve their database's performance, scalability, efficiency, and availability.
Contact us: info@mydbops.com
Visit: https://www.mydbops.com/
Follow us on LinkedIn: https://in.linkedin.com/company/mydbops
For more details and updates, please follow up the below links.
Meetup Page : https://www.meetup.com/mydbops-databa...
Twitter: https://twitter.com/mydbopsofficial
Blogs: https://www.mydbops.com/blog/
Facebook(Meta): https://www.facebook.com/mydbops/
"NATO Hackathon Winner: AI-Powered Drug Search", Taras KlobaFwdays
This is a session that details how PostgreSQL's features and Azure AI Services can be effectively used to significantly enhance the search functionality in any application.
In this session, we'll share insights on how we used PostgreSQL to facilitate precise searches across multiple fields in our mobile application. The techniques include using LIKE and ILIKE operators and integrating a trigram-based search to handle potential misspellings, thereby increasing the search accuracy.
We'll also discuss how the azure_ai extension on PostgreSQL databases in Azure and Azure AI Services were utilized to create vectors from user input, a feature beneficial when users wish to find specific items based on text prompts. While our application's case study involves a drug search, the techniques and principles shared in this session can be adapted to improve search functionality in a wide range of applications. Join us to learn how PostgreSQL and Azure AI can be harnessed to enhance your application's search capability.
7. How people build software!
!
Timeline: MySQL and JSON
7
1995: MYSQL
2002: JSON
2011: COMMON_SCHEMA
2013: MYSQL JSON UDFS
2015: NATIVE JSON
8. How people build software!
2002 - 2011
“There’s an app for that”
8
!
9. How people build software!
!
2002-2011: “There’s an app for that”
9
• Store JSON as text
• Rewrite full string every time
• Parsing happens exclusively in the application layer
• Or write your own stored procedures/functions
BUILD JSON
WRITE TO DB
STORE AS TEXT
READ FROM DB
PARSE JSON
10. How people build software!
2011 - 2013
“Standard procedures”
10
!
11. How people build software!
!
2011-2013: “Standard procedures”
11
• Store JSON as text
• Rewrite full string every time
• Some simple parsing can be done with common_schema:
• get_option()
• extract_json_value()
12. How people build software!
!
2011-2013: “Standard procedures”
12
mysql> select common_schema.extract_json_value(f.event_data,'/age') as age,
-> common_schema.extract_json_value(f.event_data,'/gender') as gender,
-> sum(f.event_count) as event_count
-> from json_event_fact f
-> group by age, gender;
+----------+---------+-------------+
| age | gender | event_count |
+----------+---------+-------------+
| Over 30 | female | 3710983 |
| Over 30 | male | 2869302 |
| Under 30 | female | 5027591 |
| Under 30 | male | 4918382 |
| unknown | female | 42039 |
| unknown | male | 50173 |
| unknown | unknown | 8372 |
+----------+---------+-------------+
14. How people build software!
!
2013-2015: “Lab experiments”
14
• Store JSON as text
• Some updates can be done with UDFs
• Much faster parsing supported by UDFs
15. How people build software!
!
2013-2015: “Lab experiments”
15
mysql> select json_extract(f.event_data,'state') as state,
-> json_extract(f.event_data,'age') as age,
-> json_extract(f.event_data,'gender') as gender,
-> sum(f.event_count) as event_count
-> from json_event_fact f
-> group by state, age, gender;
+-------+----------+--------+-------------+
| state | age | gender | event_count |
+-------+----------+--------+-------------+
| CA | 18-24 | female | 5384 |
| CA | 18-24 | male | 791 |
| CA | 18-24 | null | 25 |
| CA | 25-34 | female | 6731 |
| CA | 25-34 | male | 1292 |
| CA | 25-34 | null | 38 |
| CA | 35-44 | female | 10638 |
| CA | 35-44 | male | 1822 |
| CA | 35-44 | null | 20 |
+-------+----------+--------+-------------+
17. How people build software!
!
2015-present: “Going native”
17
• Store JSON as text or JSON datatype
• JSON datatype is binary, with keys sorted
• Fast access to embedded data
• Updates executed via native functions
• Extensive parsing supported by native functions
19. How people build software!
!
JSON_EXTRACT
19
mysql> select json_unquote(json_extract(event_data,'$.country’)) as country,
-> sum(event_count) as events
-> from json_event_fact
-> where d = current_date() - interval 1 day
-> and ad_id = 2
-> group by country;
+---------+--------+
| country | events |
+---------+--------+
| nl | 107954 |
| us | 27373 |
+---------+--------+
2 rows in set (0.00 sec)
20. How people build software!
!
JSON_SEARCH
20
mysql> select json_search(event_data,'one','android') as json_path
-> from json_event_fact
-> having json_path is not null
-> limit 1;
+-----------+
| json_path |
+-----------+
| "$.os" |
+-----------+
1 row in set (0.01 sec)
mysql> select json_search('{"fa":"la","la":["la","la"]}','all','la')G
*************************** 1. row ***************************
json_search('{"fa":"la","la":["la","la"]}','all','la'): ["$.fa", "$.la[0]",
"$.la[1]"]
1 row in set (0.00 sec)
21. How people build software!
!
JSON_REPLACE
21
mysql> set @json = cast('{"foo":"bar"}' as json);
Query OK, 0 rows affected (0.00 sec)
mysql> set @json = json_replace(@json, '$.foo', 'UPDATED');
Query OK, 0 rows affected (0.00 sec)
mysql> select @json;
+--------------------+
| @json |
+--------------------+
| {"foo": "UPDATED"} |
+--------------------+
1 row in set (0.00 sec)
22. How people build software!
!
JSON_ARRAY
22
mysql> set @json = cast('{"foo":"bar"}' as json);
Query OK, 0 rows affected (0.00 sec)
mysql> set @json = json_replace(@json, '$.foo', json_array('bar', 'car',
'far'));
Query OK, 0 rows affected (0.01 sec)
mysql> select @json;
+--------------------------------+
| @json |
+--------------------------------+
| {"foo": ["bar", "car", "far"]} |
+--------------------------------+
1 row in set (0.00 sec)
27. How people build software!
!
Flexible rollups
27
• GOAL: Support different fields for multiple customers within a single
dimension
28. How people build software!
!
Flexible rollups
28
For example, some ads track age and gender and others track country and os:
{"age":"Over 30","gender":"female"}
{"country":"us","os":"android"}
29. How people build software!
!
Flexible rollups
29
-- try to create rollup with JSON datatype
mysql> create table json_event_fact (
-> d date not null,
-> ad_id int not null,
-> event_data json not null,
-> event_count int not null,
-> primary key (d,ad_id,event_data)
-> );
ERROR 3152 (42000): JSON column 'event_data' cannot be used in key
specification.
30. How people build software!
!
Flexible rollups
30
-- use text instead
mysql> create table json_event_fact (
-> d date not null,
-> ad_id int not null,
-> event_data varchar(750) not null,
-> event_count int not null,
-> primary key (d,ad_id,event_data)
-> );
Query OK, 0 rows affected (0.05 sec)
31. How people build software!
!
Flexible rollups
31
-- generated column hack
mysql> create table json_event_fact (
-> d date not null,
-> ad_id int not null,
-> event_data json not null,
-> event_data_text varchar(750) as (cast(event_data as char)) stored,
-> event_count int not null,
-> primary key (d,ad_id,event_data_text)
-> );
Query OK, 0 rows affected (0.16 sec)
32. How people build software!
!
Flexible rollups
32
mysql> select event_data->'$.age' as age,
-> sum(event_count) as events
-> from json_event_fact
-> where d = current_date() - interval 1 day
-> and ad_id = 1
-> group by age;
+------------+---------+
| age | events |
+------------+---------+
| "Over 30" | 810424 |
| "Under 30" | 1205544 |
+------------+---------+
2 rows in set (0.03 sec)
33. How people build software!
!
Flexible rollups
33
mysql> select json_unquote(event_data->'$.country') as country,
-> sum(event_count) as events
-> from json_event_fact
-> where d = current_date() - interval 1 day
-> and ad_id = 2
-> group by country;
+---------+--------+
| country | events |
+---------+--------+
| nl | 107954 |
| us | 27373 |
+---------+--------+
2 rows in set (0.00 sec)
35. How people build software!
!
Configuration data
35
• GOAL: Store extensible configuration data of arbitrary depth for each ad
36. How people build software!
!
Configuration data
36
create table ad_config_data (
ad_config_data_id int not null primary key,
ad_id int not null,
name varchar(50) not null,
config_data json not null
);
38. How people build software!
!
Configuration data
38
{
"paths": {
"path_3007ea93": ["action_312c40f4"],
"path_30972a80": ["action_3158f2a7", "action_3185a6da",
"action_31aedd9b"],
…
},
"actions": {
"action_312c40f4": {
…
}
}
}
39. How people build software!
!
Configuration data
39
mysql> select json_extract(config_data,'$.paths.path_30c06190') as sub_paths from
ad_config_data where ad_id = 1 and name = 'actions'G
*************************** 1. row ***************************
sub_paths: ["action_5b5343af", "action_5b8b6c39", "action_5bbb05d6"]
1 row in set (0.00 sec)
mysql> update ad_config_data
-> set config_data =
json_replace(config_data,'$.paths.path_30c06190',json_array('action_5b5343af',
'action_5bbb05d6'))
-> where ad_id = 1 and name = 'actions';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select json_extract(config_data,'$.paths.path_30c06190') as sub_paths from
ad_config_data where ad_id = 1 and name = 'actions'G
*************************** 1. row ***************************
sub_paths: ["action_5b5343af", "action_5bbb05d6"]
1 row in set (0.00 sec)
40. How people build software!
!
Configuration data
40
mysql> select json_extract(config_data,'$.*.type')
-> from ad_config_data
-> where ad_id = 1
-> and name = 'layers';
+--------------------------------------+
| json_extract(config_data,'$.*.type') |
+--------------------------------------+
| ["AD", "VIDEO", "AD"] |
+--------------------------------------+
1 row in set (0.00 sec)
41. How people build software!
!
Configuration data
41
mysql> select json_search(config_data,'one','action_312c40f4')
-> from ad_config_data
-> where ad_id = 1
-> and name = 'actions';
+--------------------------------------------------+
| json_search(config_data,'one','action_312c40f4') |
+--------------------------------------------------+
| "$.paths.path_3007ea93[0]" |
+--------------------------------------------------+
1 row in set (0.00 sec)
43. How people build software!
!
EAV antidote
43
• GOAL: Store Entity-Attribute-Value style data while avoiding the EAV
antipattern
44. How people build software!
!
EAV antidote
44
• The EAV antipattern is described well by Bill Karwin in his book: “SQL
Antipatterns”
• In Bill’s example the EAV anti-pattern is used to store two types of issues
(bugs and features) in a single shared table.
45. How people build software!
!
EAV antidote
45
CREATE TABLE Issues (
issue_id SERIAL PRIMARY KEY
);
CREATE TABLE IssueAttributes (
issue_id BIGINT UNSIGNED NOT NULL,
attr_name VARCHAR(100) NOT NULL,
attr_value VARCHAR(100),
PRIMARY KEY (issue_id, attr_name),
FOREIGN KEY (issue_id) REFERENCES Issues(issue_id)
);
ATTRIBUTES STORED AS KEY-VALUE PAIRS
46. How people build software!
!
EAV antidote
46
CREATE TABLE Issues (
issue_id SERIAL PRIMARY KEY,
reported_by BIGINT UNSIGNED NOT NULL,
product_id BIGINT UNSIGNED,
priority VARCHAR(20),
version_resolved VARCHAR(20),
status VARCHAR(20),
issue_type VARCHAR(10), -- BUG or FEATURE
attributes TEXT NOT NULL, -- all dynamic attributes for the row
FOREIGN KEY (reported_by) REFERENCES Accounts(account_id),
FOREIGN KEY (product_id) REFERENCES Products(product_id)
);
47. How people build software!
!
EAV antidote
47
CREATE TABLE Issues (
issue_id SERIAL PRIMARY KEY,
reported_by BIGINT UNSIGNED NOT NULL,
product_id BIGINT UNSIGNED,
priority VARCHAR(20),
version_resolved VARCHAR(20),
status VARCHAR(20),
issue_type VARCHAR(10), -- BUG or FEATURE
attributes JSON NOT NULL, -- all dynamic attributes for the row
severity VARCHAR(20) AS (attributes->"$.severity"), -- only for bugs
version_affected VARCHAR(20) AS (attributes->"$.version_affected"), -- only for bugs
sponsor VARCHAR(50) AS (attributes->"$.sponsor"), -- only for feature requests
FOREIGN KEY (reported_by) REFERENCES Accounts(account_id),
FOREIGN KEY (product_id) REFERENCES Products(product_id)
);
48. How people build software!
JSON + Generated Columns
Two great techs that tech great together.
48
!
49. How people build software!
!
JSON + Generated Columns
49
• Allows you to expose one or more JSON fields as table columns
• Supports indexes
• Choose virtual (not stored) unless the index is Primary Key, FULLTEXT, or
GIS
50. How people build software!
!
Example #1: Add age column to rollup table
50
mysql> alter table json_event_fact
-> add column age varchar(20) as (event_data->'$.age');
Query OK, 0 rows affected (0.19 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> select age,
-> sum(event_count) as events
-> from json_event_fact
-> where d = current_date() - interval 1 day
-> and ad_id = 1
-> group by age;
+------------+---------+
| age | events |
+------------+---------+
| "Over 30" | 810424 |
| "Under 30" | 1205544 |
+------------+---------+
2 rows in set (0.00 sec)
51. How people build software!
!
Example #2: Add gender column/index to rollup
51
mysql> alter table json_event_fact
-> add column gender varchar(20) as (event_data->'$.gender'),
-> add index (gender);
Query OK, 0 rows affected (0.08 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> select sum(event_count) as events
-> from json_event_fact
-> where gender = '"female"';
+---------+
| events |
+---------+
| 1081286 |
+---------+
1 row in set (0.00 sec)
52. How people build software!
JSON vs TEXT
JSON as text versus JSON datatype
52
!
53. How people build software!
!
TEXT vs. JSON datatype
53
• Use the JSON datatype in general
• There are a few exceptions. Use text types if you need to:
• Include the column in a primary key
• Store heterogeneous data (some rows are strings, some are JSON)
• Store JSON with depth greater than 100
54. How people build software!
!
TEXT vs. JSON datatype
54
JSON data type sorts by keys:
mysql> select cast('{"c":"3","b":
{"2":"2","1":"1"},"a":"1"}' as json) as key_sort_test;
+-------------------------------------------------+
| key_sort_test |
+-------------------------------------------------+
| {"a": "1", "b": {"1": "1", "2": "2"}, "c": "3"} |
+-------------------------------------------------+
1 row in set (0.00 sec)
55. How people build software!
!
TEXT vs. JSON datatype
55
• Use the JSON_VALID() function to test validity of existing column values
before you run ALTER TABLE
• Be aware that the JSON type automatically uses the utf8mb4 character set
• Morgan Tocker has a good blog post on this topic: http://
mysqlserverteam.com/upgrading-json-data-stored-in-text-columns/
56. How people build software!
Reads versus writes
Read/write balance considerations
56
!
57. How people build software!
!
Read/write balance considerations
57
• New JSON type is read-optimized
• Every update requires rewriting the entire object
• Performance improvements are in progress for writes:
• http://dev.mysql.com/worklog/task/?id=9141
• http://dev.mysql.com/worklog/task/?id=8985
59. How people build software!
!
Disk storage implications
59
• The JSON data type’s binary format uses about the same amount of space
as text types.
• Given the nature of JSON data (keys are repeated in every row), JSON data
tends to compress well.
61. How people build software!
!
Gotchas
61
Namespace collisions between JSON UDFs and native functions:
JSON_APPEND()
JSON_DEPTH()
JSON_EXTRACT()
JSON_MERGE()
JSON_REMOVE()
JSON_REPLACE()
JSON_SEARCH()
JSON_SET()
JSON_VALID()
62. How people build software!
!
Gotchas
62
Stricter behavior of native functions:
-- MySQL 5.6 UDF
mysql> select json_extract('','foo');
+------------------------+
| json_extract('','foo') |
+------------------------+
| NULL |
+------------------------+
1 row in set (0.00 sec)
-- MySQL 5.7 native function
mysql> select json_extract('','$.foo');
ERROR 3141 (22032): Invalid JSON text in argument 1 to function json_extract: "The
document is empty." at position 0.
63. How people build software!
!
Gotchas
63
Native functions output JSON, not text:
-- MySQL 5.6 UDF
mysql> select json_extract('{"foo":"bar"}','foo');
+-------------------------------------+
| json_extract('{"foo":"bar"}','foo') |
+-------------------------------------+
| bar |
+-------------------------------------+
1 row in set (0.00 sec)
-- MySQL 5.7 native function
mysql> select json_extract('{"foo":"bar"}','$.foo');
+---------------------------------------+
| json_extract('{"foo":"bar"}','$.foo') |
+---------------------------------------+
| "bar" |
+---------------------------------------+
1 row in set (0.12 sec)
64. How people build software!
!
Gotchas
64
Path differences between JSON UDFs and native functions:
-- MySQL 5.6 UDF
mysql> select json_extract('{"parent":{"child":"hello"}}','parent','child');
+---------------------------------------------------------------+
| json_extract('{"parent":{"child":"hello"}}','parent','child') |
+---------------------------------------------------------------+
| hello |
+---------------------------------------------------------------+
1 row in set (0.00 sec)
-- MySQL 5.7 native function
mysql> select json_extract('{"parent":{"child":"hello"}}','$.parent.child');
+---------------------------------------------------------------+
| json_extract('{"parent":{"child":"hello"}}','$.parent.child') |
+---------------------------------------------------------------+
| "hello" |
+---------------------------------------------------------------+
1 row in set (0.00 sec)
65. How people build software!
!
Gotchas
65
• Cannot index JSON columns directly: use generated columns for indexing
66. How people build software!
!
Gotchas
66
Validating existing JSON values can be difficult if some rows are not valid
JSON and other rows have a depth higher than 100:
mysql> select json_text from old_table where json_valid(json_text) = 0;
ERROR 3157 (22032): The JSON document exceeds the maximum depth.
mysql> select id, json_depth(json_text) from old_table;
ERROR 3141 (22032): Invalid JSON text in argument 1 to function json_depth:
"Invalid value." at position 0.
68. How people build software!
!
JSON changes in MySQL 8.0
68
• JSON aggregate functions: http://mysqlserverteam.com/mysql-8-0-labs-json-
aggregation-functions/
• JSON_ARRAYAGG()
• JSON_OBJECTAGG()
• New function to prettify JSON values: https://dev.mysql.com/doc/refman/8.0/
en/json-utility-functions.html
• JSON_PRETTY()
• Storage used/free functions for inspecting native type
• JSON_STORAGE_FREE()
• JSON_STORAGE_SIZE()
• “JSON in place” work underway
• Optimizer piece complete
• InnoDB BLOB refactoring complete
69. How people build software!
!
Help shape the future!!!
69
• Proposal to change the behavior of JSON_MERGE: http://
mysqlserverteam.com/proposal-to-change-the-behavior-of-json_merge/
• How should JSON_MERGE() deal with overlapping values?
• Current behavior = combine all values in an array
• How should duplicate keys be handled?
• Current behavior = first key wins
• Common behavior = last key wins
70. How people build software!
Thanks!
Questions?
Please rate my talk :)
@iowalker
My team is hiring! http://bit.ly/platform-data
70
!