This document demonstrates how to use a Groovy script to access a database and retrieve or modify data using Mule's database connector.
It configures a database connection using a spring bean, defines a JDBC connector, and creates a Mule flow containing a Groovy script. The script queries or updates the database by calling the connector and passing SQL statements. Passing URL parameters allows retrieving or deleting a record by ID. Testing confirms the script can successfully retrieve and delete records by ID from the database table.
This document discusses connecting PHP to MySQL databases. It provides code examples for connecting to a MySQL server, selecting a database, executing queries, and retrieving data. It demonstrates how to insert form data submitted via POST into a MySQL table using PHP. It also shows different MySQL functions for retrieving data like mysql_fetch_array(), mysql_fetch_assoc(), mysql_fetch_row(), and mysql_fetch_object(). The document ends by explaining how to use mysql_num_rows() to get the number of rows returned by a query.
This document provides an overview of connecting to and interacting with databases in PHP using various approaches like MySQLi, PDO, and database-specific extensions. It discusses configuration of common frameworks like CodeIgniter, CakePHP, and Zend. It also covers concepts like prepared statements, stored procedures, and classes for MySQLi, PDO, and related extensions.
This document provides an introduction and overview of PostgreSQL, including its history, features, installation, usage and SQL capabilities. It describes how to create and manipulate databases, tables, views, and how to insert, query, update and delete data. It also covers transaction management, functions, constraints and other advanced topics.
This document discusses connecting to MySQL databases from PHP. It covers installing MySQL, creating databases and tables, defining data source names (DSNs) to connect, and using utilities like mysqldump to backup data and mysqlimport to import data. PHP functions like mysql_connect() and mysql_select_db() are demonstrated to connect to and select databases. The phpMyAdmin tool is also introduced as a way to manage MySQL databases through a web interface.
This document provides information about Java Database Connectivity (JDBC) and how to connect Java applications to databases. It discusses the four types of JDBC drivers, the interfaces in the JDBC API including DriverManager, Connection, Statement, and ResultSet. It also provides examples of registering drivers, establishing a database connection, executing queries, and closing the connection in five steps.
PHP provides built-in connectivity to many databases like MySQL, PostgreSQL, Oracle and more. To connect to a database in PHP, a connection is created using mysql_connect or mysql_pconnect, which may create a persistent connection. The high-level process involves connecting to the database, selecting a database, performing a SQL query, processing the results, and closing the connection. Key functions include mysql_query() to submit queries, mysql_fetch_array() to retrieve rows from the results, and mysql_close() to terminate the connection.
This document provides an introduction and overview of PostgreSQL, an open-source object-relational database management system. It discusses that PostgreSQL supports modern SQL features, has free commercial and academic use, and offers performance comparable to other databases while being very reliable with stable code and robust testing. The architecture uses a client-server model to handle concurrent connections and transactions provide atomic, isolated, and durable operations. PostgreSQL also supports user-defined types, inheritance, and other advanced features.
Stored procedures allow developers to encapsulate business logic and rules in the database for improved maintainability, testability, security, and performance. The Mule Database component supports executing stored procedures. A developer can create a stored procedure in their database, then call it from a Mule flow using the Database component by specifying the stored procedure name. This retrieves data from the database and executes the stored procedure logic.
This document discusses various topics related to installing, configuring, and managing MySQL databases including:
- Using command line tools like mysqladmin and mysql to configure and manage MySQL.
- Installing MySQL via packages or source code and configuring startup settings.
- Creating, deleting, and managing databases, tables, and user privileges.
- Performing backups with mysqldump and restoring from backups.
- Monitoring the status of the MySQL server process.
The document provides an overview of SQL and its characteristics. It discusses that SQL is a standard language for relational database management systems and provides a high-level declarative interface. The document also describes the different components of SQL including data definition language, data manipulation language, and data control language. It provides examples of creating tables and databases, inserting and querying data, and other SQL statements.
This document discusses parsing an XML payload in Mule ESB using DataWeave. It provides an example XML input file with user data. It then shows a Mule flow configuration that uses a DataWeave transform to parse the XML payload and output it as a Java object with the first and last name values. The DataWeave code treats the XML payload like a static class in Java to retrieve the name and last name values from the XML tags and assign them to variables.
Common Schema is a MySQL DBA toolkit that provides a self-contained database schema with tables, views, and stored routines. It allows users to monitor servers, analyze security and objects, and access documentation directly from SQL queries. The presentation introduces Common Schema's key capabilities and provides examples of monitoring status variables, accessing help documentation, and analyzing data size and object information.
The document provides an overview of developing a 3-tier web application using MySQL, JavaServer Pages (JSP), and Apache Tomcat. It discusses the architecture of a 3-tier system with separate data, application, and presentation tiers. It also provides information on using MySQL for the database tier, JSP and servlets for the application tier, and HTML/JSP for the presentation tier. The document gives examples of using MySQL commands and JSP tags and objects.
MuleSoft ESB Message Enricher
Need to enrich an incoming message with information that isn’t provided by the source system. Use a content enricher if the target system needs more information than the source system can provide.
MySQL is a free, open-source relational database management system that is ideal for both small and large applications. PHP can connect to and interact with a MySQL database using extensions like MySQLi or PDO. The document provides code examples for connecting to a MySQL database, executing queries to retrieve, insert, update, and delete data, and other common MySQL operations when using PHP.
This document provides an introduction and instructions for connecting a PHP application to a MySQL database. It discusses storing and retrieving data from the database. The key steps covered are:
1. Connecting to the MySQL server from PHP using mysql_connect().
2. Selecting the database to use with mysql_select_db().
3. Executing SQL queries to store/retrieve data with mysql_query().
4. Different mysql_fetch_* functions that can be used to retrieve rows of data from a database query.
An example task is provided where a registration form allows storing user data to a database table, and then retrieving and displaying the stored data in a table.
This document discusses connecting to and interacting with MySQL databases from PHP. It covers connecting to a MySQL database server, selecting databases, executing SQL statements, working with query results, and inserting, updating and deleting records. Functions covered include mysql_connect(), mysql_query(), mysql_fetch_row(), mysql_affected_rows(), and mysql_info(). The document provides examples of connecting to MySQL, selecting databases, executing queries, and accessing and manipulating data.
This document discusses how to compress and decompress payloads in Mule flows. It describes using the gzip-compress-transformer to compress a payload, which reduces its size, and the gzip-uncompress-transformer to decompress it back to the original size. An example is provided of a flow that picks up a 83 KB file, compresses it reducing it to 21.99 KB, then decompresses it back to the original 83 KB size.
This document describes using DataWeave in Mule ESB to transform XML input into a Java object. It includes an XML input file, Mule flow configuration with a DataWeave transform, and a User Java class. The DataWeave transform defines a 'user' object type and maps the XML elements to fields on the User class, setting the payload to a User instance.
This document provides information about servlets and the servlet API. It defines a servlet as a Java program that runs on a web server and responds to client requests. It discusses how servlets use interfaces like Servlet, ServletConfig, and ServletContext to access configuration and context information. It also describes how HTTPServlet handles HTTP requests and responses using methods like doGet and doPost. The document explains the servlet lifecycle of initialization, processing requests via service(), and destruction. It provides examples of using the HttpRequest and HttpResponse interfaces to read request data and send responses.
This document discusses using Mule ESB to scatter gather messages by sending the same payload to multiple destinations. It also covers encrypting and decrypting payloads using Base64 encoding. Specifically, it describes creating a flow that takes a file from an input folder, encrypts it using Base64, scatters it to two encode folders, then decrypts and sends it to a final decode folder, logging the process.
Python (Jinja2) Templates for Network AutomationRick Sherman
Templates allow network configurations to be defined separately from the configuration data. This makes configurations reusable, shareable, and easy to update. Jinja2 is a popular template language that allows variables, conditionals, loops, and inheritance in templates. Templates separate the "how" of the configuration syntax from the "what" of the configuration data values. This document provides examples of basic Jinja2 template features like variables, filters, includes, inheritance blocks, and using data sources.
The document discusses various CRUD (create, read, update, delete) operations in SQLite using Python. It covers creating a database and table, inserting, retrieving, updating, and deleting data from the table. Code examples and explanations are provided for each operation. Key methods for SQLite in Python like connect(), execute(), commit(), close() are also explained.
This document provides an example of using DataWeave to transform XML input into a Java Object. The XML input contains user data that is mapped to a User class using DataWeave transformations. The User class is defined with firstName and lastName properties that correspond to the name and lastName elements in the XML. DataWeave code is used to parse the XML payload and set the properties of a User object that is returned.
This document discusses parsing an XML payload in Mule ESB using DataWeave. It provides an example XML input file with user data. It then shows a Mule flow configuration that uses a DataWeave transform to parse the XML payload and set the payload to a JSON output with the first and last names from the XML. The DataWeave code treats the XML payload like a static class to retrieve the name and last name values from the XML tags.
NEO WEBSITE DEVELOPMENT SOLUTIONS has been developing websites since 2007 in Odisha and Karnataka. They were the first non-media Indian company to launch an online live TV and the first web development firm worldwide to provide online strategy consultancy through micro-sites. They offer affordable and customizable website development solutions starting from Rs. 5000 along with SEO and social media optimization services.
The document discusses the overview, architecture, and features of mysql-proxy. Mysql-proxy sits between applications and databases, allowing for load balancing, connection management, and query filtering/modification through an embedded Lua scripting language. Key features include read-only splitting, access control, statistics gathering, and a programmable admin interface.
El documento proporciona la dirección de Urbina FC en Av 6 Dic y Ramon Borja 2344567-687878. También incluye el sitio web de Urbina FC en http://urbinafc.blogspot.com, que se repite tres veces en el documento.
Stored procedures allow developers to encapsulate business logic and rules in the database for improved maintainability, testability, security, and performance. The Mule Database component supports executing stored procedures. A developer can create a stored procedure in their database, then call it from a Mule flow using the Database component by specifying the stored procedure name. This retrieves data from the database and executes the stored procedure logic.
This document discusses various topics related to installing, configuring, and managing MySQL databases including:
- Using command line tools like mysqladmin and mysql to configure and manage MySQL.
- Installing MySQL via packages or source code and configuring startup settings.
- Creating, deleting, and managing databases, tables, and user privileges.
- Performing backups with mysqldump and restoring from backups.
- Monitoring the status of the MySQL server process.
The document provides an overview of SQL and its characteristics. It discusses that SQL is a standard language for relational database management systems and provides a high-level declarative interface. The document also describes the different components of SQL including data definition language, data manipulation language, and data control language. It provides examples of creating tables and databases, inserting and querying data, and other SQL statements.
This document discusses parsing an XML payload in Mule ESB using DataWeave. It provides an example XML input file with user data. It then shows a Mule flow configuration that uses a DataWeave transform to parse the XML payload and output it as a Java object with the first and last name values. The DataWeave code treats the XML payload like a static class in Java to retrieve the name and last name values from the XML tags and assign them to variables.
Common Schema is a MySQL DBA toolkit that provides a self-contained database schema with tables, views, and stored routines. It allows users to monitor servers, analyze security and objects, and access documentation directly from SQL queries. The presentation introduces Common Schema's key capabilities and provides examples of monitoring status variables, accessing help documentation, and analyzing data size and object information.
The document provides an overview of developing a 3-tier web application using MySQL, JavaServer Pages (JSP), and Apache Tomcat. It discusses the architecture of a 3-tier system with separate data, application, and presentation tiers. It also provides information on using MySQL for the database tier, JSP and servlets for the application tier, and HTML/JSP for the presentation tier. The document gives examples of using MySQL commands and JSP tags and objects.
MuleSoft ESB Message Enricher
Need to enrich an incoming message with information that isn’t provided by the source system. Use a content enricher if the target system needs more information than the source system can provide.
MySQL is a free, open-source relational database management system that is ideal for both small and large applications. PHP can connect to and interact with a MySQL database using extensions like MySQLi or PDO. The document provides code examples for connecting to a MySQL database, executing queries to retrieve, insert, update, and delete data, and other common MySQL operations when using PHP.
This document provides an introduction and instructions for connecting a PHP application to a MySQL database. It discusses storing and retrieving data from the database. The key steps covered are:
1. Connecting to the MySQL server from PHP using mysql_connect().
2. Selecting the database to use with mysql_select_db().
3. Executing SQL queries to store/retrieve data with mysql_query().
4. Different mysql_fetch_* functions that can be used to retrieve rows of data from a database query.
An example task is provided where a registration form allows storing user data to a database table, and then retrieving and displaying the stored data in a table.
This document discusses connecting to and interacting with MySQL databases from PHP. It covers connecting to a MySQL database server, selecting databases, executing SQL statements, working with query results, and inserting, updating and deleting records. Functions covered include mysql_connect(), mysql_query(), mysql_fetch_row(), mysql_affected_rows(), and mysql_info(). The document provides examples of connecting to MySQL, selecting databases, executing queries, and accessing and manipulating data.
This document discusses how to compress and decompress payloads in Mule flows. It describes using the gzip-compress-transformer to compress a payload, which reduces its size, and the gzip-uncompress-transformer to decompress it back to the original size. An example is provided of a flow that picks up a 83 KB file, compresses it reducing it to 21.99 KB, then decompresses it back to the original 83 KB size.
This document describes using DataWeave in Mule ESB to transform XML input into a Java object. It includes an XML input file, Mule flow configuration with a DataWeave transform, and a User Java class. The DataWeave transform defines a 'user' object type and maps the XML elements to fields on the User class, setting the payload to a User instance.
This document provides information about servlets and the servlet API. It defines a servlet as a Java program that runs on a web server and responds to client requests. It discusses how servlets use interfaces like Servlet, ServletConfig, and ServletContext to access configuration and context information. It also describes how HTTPServlet handles HTTP requests and responses using methods like doGet and doPost. The document explains the servlet lifecycle of initialization, processing requests via service(), and destruction. It provides examples of using the HttpRequest and HttpResponse interfaces to read request data and send responses.
This document discusses using Mule ESB to scatter gather messages by sending the same payload to multiple destinations. It also covers encrypting and decrypting payloads using Base64 encoding. Specifically, it describes creating a flow that takes a file from an input folder, encrypts it using Base64, scatters it to two encode folders, then decrypts and sends it to a final decode folder, logging the process.
Python (Jinja2) Templates for Network AutomationRick Sherman
Templates allow network configurations to be defined separately from the configuration data. This makes configurations reusable, shareable, and easy to update. Jinja2 is a popular template language that allows variables, conditionals, loops, and inheritance in templates. Templates separate the "how" of the configuration syntax from the "what" of the configuration data values. This document provides examples of basic Jinja2 template features like variables, filters, includes, inheritance blocks, and using data sources.
The document discusses various CRUD (create, read, update, delete) operations in SQLite using Python. It covers creating a database and table, inserting, retrieving, updating, and deleting data from the table. Code examples and explanations are provided for each operation. Key methods for SQLite in Python like connect(), execute(), commit(), close() are also explained.
This document provides an example of using DataWeave to transform XML input into a Java Object. The XML input contains user data that is mapped to a User class using DataWeave transformations. The User class is defined with firstName and lastName properties that correspond to the name and lastName elements in the XML. DataWeave code is used to parse the XML payload and set the properties of a User object that is returned.
This document discusses parsing an XML payload in Mule ESB using DataWeave. It provides an example XML input file with user data. It then shows a Mule flow configuration that uses a DataWeave transform to parse the XML payload and set the payload to a JSON output with the first and last names from the XML. The DataWeave code treats the XML payload like a static class to retrieve the name and last name values from the XML tags.
NEO WEBSITE DEVELOPMENT SOLUTIONS has been developing websites since 2007 in Odisha and Karnataka. They were the first non-media Indian company to launch an online live TV and the first web development firm worldwide to provide online strategy consultancy through micro-sites. They offer affordable and customizable website development solutions starting from Rs. 5000 along with SEO and social media optimization services.
The document discusses the overview, architecture, and features of mysql-proxy. Mysql-proxy sits between applications and databases, allowing for load balancing, connection management, and query filtering/modification through an embedded Lua scripting language. Key features include read-only splitting, access control, statistics gathering, and a programmable admin interface.
El documento proporciona la dirección de Urbina FC en Av 6 Dic y Ramon Borja 2344567-687878. También incluye el sitio web de Urbina FC en http://urbinafc.blogspot.com, que se repite tres veces en el documento.
- The document discusses ecommerce solutions and services provided by 8iCreations including website development, mobile commerce, SEO, social media marketing, and administration tools.
- A variety of pricing packages are provided starting at Rs. 7,000 per year for basic features up to customized solutions priced on request.
- Services include development of ecommerce sites, blogs, mobile sites, integration of online and offline stores, and custom software solutions.
This document discusses connecting PHP to a MySQL database. It explains how to connect to a MySQL database, select a database, query and access tables, and perform common SQL commands like INSERT, UPDATE, DELETE from PHP scripts. Examples are provided of connecting to a database, selecting the table, fetching rows from a query result, and using the data to generate an HTML table. The key steps are connecting to the MySQL server, selecting the database, constructing SQL queries to select, update, or delete data, and handling the result rows.
MySQL Proxy: Architecture and concepts of misuseweigon
MySQL Proxy is a MySQL toolbox started in 2007 that allows inspecting and modifying MySQL traffic. It uses a Lua scripting layer to implement plugins for logging, auditing, routing queries, and injecting queries. The core libraries provide functionality for the network protocol, command line interface, configuration files, logging, and plugin loading. It aims to be a "good man in the middle" for MySQL operations.
The document discusses using plProxy and pgBouncer to split a PostgreSQL database horizontally and vertically to improve scalability. It describes how plProxy allows functions to make remote calls to other databases and how pgBouncer can be used for connection pooling. The RUN ON clause of plProxy is also summarized, which allows queries to execute on all partitions or on a specific partition.
Understanding ProxySQL internals and then interacting with some common features of ProxySQL such as query rewriting, mirroring, failovers, and ProxySQL Cluster
PostgreSQL is a free and open-source relational database management system that provides high performance and reliability. It supports replication through various methods including log-based asynchronous master-slave replication, which the presenter recommends as a first option. The upcoming PostgreSQL 9.4 release includes improvements to replication such as logical decoding and replication slots. Future releases may add features like logical replication consumers and SQL MERGE statements. The presenter took questions at the end and provided additional resources on PostgreSQL replication.
The document discusses using Python's DB-API interface to write scripts that interact with MySQL databases. It describes installing the MySQLdb driver module, creating a connection to a MySQL server, executing queries using cursor objects, and retrieving and printing the results. A sample script is provided that connects to a test database, executes queries to create and populate a table with animal data, then selects and prints the data from the table.
This document describe step by step how to configure Oracle Gateway to create Database link between oracle and MySQL On Solaris 11.1 , The same steps can be done on Linux or Unix.
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLUlf Wendel
HTTP, JSON, JavaScript, Map&Reduce built in to MySQL - make it happen, today. See how a MySQL Server plugin be developed to built all this into MySQL. A new direct wire between MySQL and client-side JavaScript is created. MySQL speaks HTTP, replies JSON and offers server-side JavaScript. Server-side JavaScript gets access to MySQL data and does Map&Reduce of JSON documents stored in MySQL. Fast? 2-4x faster than proxing client-side JavaScript request through PHP/Apache. Reasonable results...
Mysqlnd, an unknown powerful PHP extensionjulien pauli
The document discusses mysqlnd, a PHP extension that replaces libmysql. Mysqlnd provides significant memory savings when processing result sets by avoiding duplicating result data in memory. It also includes detailed statistics collection and an extensible plugin architecture. Mysqlnd is now the default MySQL connector used by PHP.
MySQL Replication Evolution -- Confoo Montreal 2017Dave Stokes
MySQL Replication has evolved since the early days with simple async master/slave replication with better security, high availability, and now InnoDB Cluster
This document discusses how to connect to a MySQL database using the mysql binary from the command line and using PHP scripts. It provides an example of connecting to MySQL from the command line using the mysql command and authenticating with username and password. It also discusses the mysql_connect() and mysql_close() PHP functions for opening and closing connections to a MySQL database from within a PHP script, including their syntax and parameters. An example PHP script is given that demonstrates connecting to a MySQL server using these functions.
This document outlines how to configure multiple instances of MySQL on a single server. It describes commenting out port settings in the my.cnf file, creating configuration blocks for two instances, cloning the data directory for the second instance, and using mysqld_multi to start and manage the instances. Running mysqld_multi report verifies that both instances are running on different ports (3306 and 3307). Clients can connect to each instance by specifying the unique port or socket file location.
This document summarizes a presentation about MySQL and PHP. It discusses the mysqlnd extension in PHP and how it differs from using the libmysql client library. Key points include that mysqlnd is bundled with PHP by default now, has some additional features like asynchronous queries, but is still less mature than libmysql. The document also demonstrates how mysqlnd and libmysql return different data types from MySQL queries and how this impacts memory usage when fetching result sets.
Scaling asp.net websites to millions of usersoazabir
This document discusses various techniques for optimizing ASP.NET applications to scale from thousands to millions of users. It covers topics such as preventing denial of service attacks, optimizing the ASP.NET process model and pipeline, reducing the size of ASP.NET cookies on static content, improving System.net settings, optimizing queries to ASP.NET membership providers, issues with LINQ to SQL, using transaction isolation levels to prevent deadlocks, and employing a content delivery network. The overall message is that ASP.NET requires various "hacks" at the code, database, and configuration levels to scale to support millions of hits.
Confoo.ca conference talk February 24th 2021 on MySQL new features found in version 8.0 including server and supporting utility updates for those who may have missed some really neat new features
Dennis Wittekind, Confluent, Senior Customer Success Engineer
Perhaps you have heard of Kafka Connect and think it would be a great fit in your application's architecture, but you like to know how things work before you propose them to your team? Perhaps you know enough Connect to be dangerous, but you haven't had the time to really understand all the moving pieces? This meetup talk is for you! We'll briefly introduce Connect to the uninitiated, and then jump in to underlying concepts and considerations you should make when running Connect in production! We'll even run a live demo! What could go wrong!?
https://www.meetup.com/Saint-Louis-Kafka-meetup-group/events/272687113/
Www Kitebird Com Articles Pydbapi Html Toc 1AkramWaseem
The document discusses using Python and the DB-API module to write scripts that interact with MySQL databases. It provides an example of a short script that connects to a MySQL database, issues a query to get the server version, and prints the result. It then discusses a more extensive script that handles errors, issues different statement types like INSERT and SELECT, and retrieves result rows using fetchone() and fetchall() methods. The document provides information on installing prerequisites like Python and MySQLdb, and executing the example scripts.
This document discusses new capabilities in CFEngine 3, an advanced configuration management system. Key points include:
- CFEngine 3 is declarative, ensures desired state is reached through convergence, is lightweight using 3-6MB of memory, and can run continuously to check configurations every 5 minutes.
- It supports both new platforms like ARM boards and older systems like Solaris.
- Recent additions allow managing resources like SQL databases, XML files, and virtual machines in a code-free manner using the Design Center.
- CFEngine treats all resources like files, processes, and VMs as maintainable and ensures they self-correct through convergence to the desired state.
Slide deck for my presentation at MongoSF 2012 in May: http://www.10gen.com/presentations/mongosf-2012/mongodb-new-aggregation-framework .
Kuyper Hoffmann's presentation from the #lspe "Private Clouds" event: http://www.meetup.com/SF-Bay-Area-Large-Scale-Production-Engineering/events/48901162/
The document discusses MongoDB's new aggregation framework, which provides a declarative pipeline for performing data aggregation operations on complex documents. The framework allows users to describe a chain of operations without writing JavaScript. It will offer high-performance operators like $match, $project, $unwind, $group, $sort, and computed expressions to reshape and analyze document data without the overhead of JavaScript. The aggregation framework is nearing release and will support sharding by forwarding pipeline operations to shards and combining results.
Replication in MongoDB allows for high availability and scaling of reads. A replica set consists of at least three mongod servers, with one primary and one or more secondaries that replicate from the primary. Writes go to the primary while reads can be distributed to secondaries for scaling. Replica sets are configured and managed through shell helpers, and maintain consistency through an oplog and elections when the primary is unavailable.
Architecting a Scale Out Cloud Storage SolutionChris Westin
Mark Skinner's presentation to #lspe at http://www.meetup.com/SF-Bay-Area-Large-Scale-Production-Engineering/events/15481232/
Mohan Srinivasan's presentation to #lspe at http://www.meetup.com/SF-Bay-Area-Large-Scale-Production-Engineering/events/15481232/
Mike Lindsey's presentation for The Return of Not Nagios http://www.meetup.com/SF-Bay-Area-Large-Scale-Production-Engineering/events/15481175/
Replication in MongoDB allows for high availability and scaling of reads. A replica set consists of at least three mongod servers, with one primary and one or more secondaries that replicate from the primary. The primary applies all write operations to its oplog, which is then replicated to the secondaries. If the primary fails, a new primary is elected from the remaining secondaries. Administrative commands help monitor and manage the replica set configuration.
Presentation to the SVForum Architecture and Platform SIG meetup http://www.meetup.com/SVForum-SoftwareArchitecture-PlatformSIG/events/20823081/
Vladimir Vuksan's presentation on Ganglia at the "Not Nagios" episode of The Bay Area Large-Scale Production Engineering meetup: http://www.meetup.com/SF-Bay-Area-Large-Scale-Production-Engineering/events/15481164/
This document discusses MongoDB's new aggregation framework, which provides a more performant and declarative way to perform data aggregation tasks compared to MapReduce. The framework includes pipeline operations like $match, $project, and $group that allow filtering, reshaping, and grouping documents. It also features an expression language for computed fields. The initial release will support aggregation pipelines and sharding, with future plans to add more operations and expressions.
1. LSPE @Yahoo mysql-proxy By Farhad Saberi - Overview and architecture - Making The case for a proxy - Lua - Lua examples - The admin interface - currently known issues
2. Overview and Architecture Same idea as any other proxy. Sits between the application and its Database:
3. Overview and Arhitecture Read only Load Balancing with multiple –proxy-read-only-backend-addresses option
4. Making The case for mysql-proxy Easier sites management. Hundreds of connection definitions use the same host and port. DB Host connection changes are done at one place only.
5. No need to restart for configuration or behavioral changes. It all happens in real time.
6. Making the case for mysql-proxy Flexible, Powerful and invisible: intercept, tokenize and modify queries
21. LUA Mysql-proxy is the application code and Lua is its extension language . You change a running mysql-proxy's behavior and variables in a single Lua script in real time (no restart required).
22. Lua examples Mysql-proxy starts with – proxy-backend-addresses=db1.host.net, db2.host.net, db3.host.net Choose your backend in connect_server() Function connect_server() proxy.connection.backend_ndx= 2 End And you will always connect to db2.host.net. If you change 2 to 3, you will always connect to db3. Note: Lua's array starts at 1, !0
23. Lua examples Deny all queries to any backend DB: function read_query(packet) if string.byte(packet) == proxy.COM_QUERY then local fields = { } local rows = { } fields = { { name = “ message from DBA ”, type =proxy.MYSQL_TYPE_STRING}, } rows[1] = { “ maintenance ”} proxy.respose = { type = proxy.MYSQLD_PACKET_OK, resultset = { fields = fields, rows = rows } } return proxy.PROXY_SEND_RESULT –means bypass backend, return to client now end end
24. Lua examples For any query issued, this will be the result: mysql> show tables; # or anything else +--------------------------+ | message from DBA | +--------------------------+ | maintenance | +---------------------------+
25. Lua example denying access to just one table using a regex. Return mysql error msg to client. Function read_query(packet) if packet:byte() == proxy.COM_QUERY then local query= packet:sub(2) print (“query: “ .. query ) – debugging purpose if string.match(query:lower(), “ from%s+.*my_table ” ) then proxy.response.type = proxy.MYSQLD_PACKET_ERR proxy.response.errmsg = “ access denied to table my_table ” return proxy.PROXY_SEND_RESULT end end end
26. Lua example Running any query that would match “from%s+.* my_table” will return ERROR 1105 (07000): access denied to table my_table
27. Lua example Some other things you can do: Start/stop mysqld backend.
28. Choose your backend DB based on which IP address, or which mysql user the client has.
29. Modify result set by adding or removing a column from the returned table.
32. The admin interface You can monitor and show internal structures of the running mysql-proxy process by programming your own admin interface in Lua.
38. The admin interface Function read_query(packet) If packet:byte() ~= proxy.COM_QUERY then return_error(“ [admin] we only handle COM_QUERY ”); --user defined end Local rows = { } local fields = { } – no need for a semicolon in Lua if packet:sub(2) == “ls” then – if query is an ls fields = { { name = “ backend_ndx ”, type = proxy.MYSQL_TYPE_LONG }, { name = “ address ” , type = proxy.MYSQL_TYPE_STRING } , { name = “ connected_clients ”, type = proxy.MYSQL_TYPE_LONG}, } for i = 1 , #proxy.global.backends do Local b = proxy.global.backends[i] rows[#rows + 1 ] = { i, b.dst.name, b.connected_clients } end end … Now build proxy.response and return with proxy.PROXY_SEND_RESULT
40. Currently known issues Read/Write splitting does not work if used by more than one client on the same proxy process. This is a known issue and I'm assuming it is being worked on.