Making schema changes to large tables in MySQL can become a major issue as data grows. This talk outlines a method to change large MySQL tables with little impact to running production services and replication.
Storing Time Series Metrics With Cassandra and Composite ColumnsJoe Stein
This document discusses storing and aggregating time series metrics in Cassandra using counters and composite columns. It provides an example schema using multiple column families partitioned by time period (day, hour, minute, second). Data is inserted by incrementing counters for composite column names representing the aggregated values. Retrieval involves multiget queries on ranges of composite column names to retrieve aggregated counts for a time period.
The document discusses MongoDB commands and operations for working with databases, collections, and documents. It shows how to import sample data, query and filter documents, count documents, create indexes, insert new documents, and remove documents. Examples demonstrate finding documents by field values, projecting specific fields, sorting results, and getting distinct field values.
This document discusses using Cucumber with Groovy for behavior-driven development on the JVM. It provides an overview of Groovy and why it is useful for testing Java code. It also describes how Cucumber supports the Groovy domain-specific language for automating scenarios. Examples are given for defining step definitions in Groovy using regular expressions, tables, multiline strings, and organizing definitions. The document also shows how to integrate Geb for browser automation and use the World object to share state between steps.
This talk is about a success story of partitioning an existing PostgreSQL 9.6 1B rows table, live, in production, running on Amazon RDS.
The talk will present how the partitioning was designed, the analysis steps done while testing the best approach to move the data and why we ended doing a live partitioning instead of a more secure offline partitioning. We also will see how we would have done that using PostgreSQL 10’s new partitioning features.
This document provides an introduction to MySQL basics, including terminology, creating and using databases, inserting and retrieving data, updating and deleting data, joins, indexes, and optimization. Key topics covered include how to create databases and tables, insert, select, update, and delete data, and how to improve query performance using indexes and the slow query log.
This document provides a summary of JSON improvements in MySQL 8.0. It discusses MySQL's support for the JSON data type and functions for formatting, manipulating, searching and collecting statistics on JSON documents. Key changes and improvements in MySQL 8.0 include faster JSON updates and replication using partial JSON updates, new functions for transforming JSON to relational data and removing ambiguity, and performance optimizations. The document also provides examples of common JSON functions for formatting, manipulating, searching and collecting stats on JSON documents.
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017Mike Nakhimovich
The document discusses data loading and how the NY Times built the Store library to simplify it. Some key points:
- Store manages fetching, parsing, and caching of data for a specific model. It handles all the data flow in a reactive and persistent way.
- Stores are Observable objects that provide methods like get(), fetch(), and stream() to interact with data.
- The Store library uses repositories, parsers, and persisters to abstract where data comes from and how it's stored, cached, and transformed.
- Stores help achieve goals like surviving configuration changes, reducing memory usage, and standardizing offline behavior. They make data loading asynchronous, reactive, and dependent calls easier.
Storing Time Series Metrics With Cassandra and Composite ColumnsJoe Stein
This document discusses storing and aggregating time series metrics in Cassandra using counters and composite columns. It provides an example schema using multiple column families partitioned by time period (day, hour, minute, second). Data is inserted by incrementing counters for composite column names representing the aggregated values. Retrieval involves multiget queries on ranges of composite column names to retrieve aggregated counts for a time period.
The document discusses MongoDB commands and operations for working with databases, collections, and documents. It shows how to import sample data, query and filter documents, count documents, create indexes, insert new documents, and remove documents. Examples demonstrate finding documents by field values, projecting specific fields, sorting results, and getting distinct field values.
This document discusses using Cucumber with Groovy for behavior-driven development on the JVM. It provides an overview of Groovy and why it is useful for testing Java code. It also describes how Cucumber supports the Groovy domain-specific language for automating scenarios. Examples are given for defining step definitions in Groovy using regular expressions, tables, multiline strings, and organizing definitions. The document also shows how to integrate Geb for browser automation and use the World object to share state between steps.
This talk is about a success story of partitioning an existing PostgreSQL 9.6 1B rows table, live, in production, running on Amazon RDS.
The talk will present how the partitioning was designed, the analysis steps done while testing the best approach to move the data and why we ended doing a live partitioning instead of a more secure offline partitioning. We also will see how we would have done that using PostgreSQL 10’s new partitioning features.
This document provides an introduction to MySQL basics, including terminology, creating and using databases, inserting and retrieving data, updating and deleting data, joins, indexes, and optimization. Key topics covered include how to create databases and tables, insert, select, update, and delete data, and how to improve query performance using indexes and the slow query log.
This document provides a summary of JSON improvements in MySQL 8.0. It discusses MySQL's support for the JSON data type and functions for formatting, manipulating, searching and collecting statistics on JSON documents. Key changes and improvements in MySQL 8.0 include faster JSON updates and replication using partial JSON updates, new functions for transforming JSON to relational data and removing ambiguity, and performance optimizations. The document also provides examples of common JSON functions for formatting, manipulating, searching and collecting stats on JSON documents.
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017Mike Nakhimovich
The document discusses data loading and how the NY Times built the Store library to simplify it. Some key points:
- Store manages fetching, parsing, and caching of data for a specific model. It handles all the data flow in a reactive and persistent way.
- Stores are Observable objects that provide methods like get(), fetch(), and stream() to interact with data.
- The Store library uses repositories, parsers, and persisters to abstract where data comes from and how it's stored, cached, and transformed.
- Stores help achieve goals like surviving configuration changes, reducing memory usage, and standardizing offline behavior. They make data loading asynchronous, reactive, and dependent calls easier.
GeoDjango allows you to work with geographic data seamlessly in Django. It adds spatial lookups to the Django ORM so you can query geographic objects by distance and location. Setting up GeoDjango involves installing PostGIS and GEOS libraries, creating a spatial database, configuring Django settings to use the PostGIS database engine, and registering geographic models with GeoManager. The admin site can also be customized to display maps using templates that include Google Maps JavaScript API.
Would you like to make your Android UI code cleaner and more reactive? Android data binding can help. In this talk you’ll learn everything you need to know about data binding, including why it’s so powerful and how to use it effectively. If you haven’t tried data binding in the past, that’s okay! We’ll start with the basics, assuming no prior knowledge and slowly move into more advanced topics, such as 2-way binding, binding adapters, converters, best practices and common pitfalls to avoid.
SH 1 - SES 6 - compass-tel-aviv-slides.pptxMongoDB
This document provides information about writing plugins for MongoDB Compass. It discusses where plugins can fit visually in Compass, including the header, instance tabs, database tabs, collection tabs, and collection heads up displays. It also covers the components that make up a Compass plugin, including React components, stores, actions, and lifecycle hooks. Finally, it walks through an example of creating a simple "whoami" plugin that displays the current user and role by making a connectionStatus database command call.
This document discusses new SQL syntax and query rewrite plugins in MySQL. It introduces FILTER clauses and custom optimizer hints and describes how to implement them using query rewrite plugins. Key points covered include the plugin interface, parsing and rewriting queries, managing memory, and customizing variables. The goal is to add new SQL features and control query execution through simple syntax extensions. Examples of implementing FILTER clauses and custom optimizer hints are provided to demonstrate how rewrite plugins work.
Change tracking is a lightweight solution that provides an efficient change tracking mechanism for applications. Typically, to enable applications to query for changes to data in a database and access information that is related to the changes, application developers had to implement custom change tracking mechanisms. Creating these mechanisms usually involved a lot of work and frequently involved using a combination of triggers, timestamp columns, new tables to store tracking information, and custom cleanup processes.
The document summarizes new features in iOS 7, including updates to the Text Kit framework, customizable view controller transitions, improved support for iCloud integration with Core Data, validating App Store receipts, speech synthesis with AVFoundation, evaluating JavaScript with JavaScriptCore, and new networking APIs for background tasks, AirDrop, Multipeer Connectivity, and iBeacons. The document provides code examples for implementing many of these new features.
EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...martinlippert
This document discusses optimizing performance in Eclipse-based tools. It recommends measuring performance using tools like VisualVM and YourKit to identify issues. Common problems include expensive calls in loops and slow builders. Solutions include caching results, reducing garbage collection, and optimizing for common cases. When implementing visitors or type checking, it is important to avoid iterating over collections and make the code simple and fast. Reading bytecode directly is faster than using Eclipse APIs. Reconciling and content assist need to be optimized as they must be fast. Caching and reducing startup workload can improve startup time. The overall approach is to measure, optimize, and repeat.
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
This document provides instructions for minimizing downtime when performing a major version upgrade of PostgreSQL using logical replication with Slony. It discusses various methods for performing the upgrade, including dump/restore, pg_upgrade, and logical replication with Slony. It then provides a step-by-step guide to setting up logical replication between two PostgreSQL nodes using Slony, including initializing the cluster and nodes, creating replication sets, subscribing nodes, and monitoring the initial synchronization process. The document demonstrates how Slony allows performing a graceful switchover and switchback between nodes when upgrading PostgreSQL versions.
Android Lollipop internals and inferiority complex droidcon.hr 2015 Aleksander Piotrowski
Presentation from droidcon Zagreb 2015
While going through JobScheduler internals try to answer the following question: How big is the gap between us and rockstar developers from Google or Square
Internationalizing CakePHP ApplicationsPierre MARTIN
The document discusses internationalization in CakePHP, including:
- Using methods like __() and __n() to translate text strings, and Configure::write() to set the application language.
- The Translate behavior, which allows translating database records into multiple languages and automatically filtering by the current language.
- Generating translation files using the i18n extractor, editing them with POEDIT, and caching translated elements.
The document provides information on various SQL commands used for data manipulation and control, database objects like tables and schemas, users and privileges in SQL. It discusses commands like COMMIT, ROLLBACK, GRANT, REVOKE used for transactions and managing privileges. It also summarizes creation, alteration and deletion of database objects using commands like CREATE, ALTER, DROP and functions like SELECT, INSERT, UPDATE, DELETE for data manipulation. The document further discusses concepts like stored procedures in SQL and use of phpMyAdmin for administering MySQL databases.
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway ichikaway
This document discusses using MongoDB with CakePHP. It covers setting up MongoDB and the CakePHP MongoDB plugin, using MongoDB features like schema flexibility and operators in CakePHP models and controllers, and accessing the MongoDB and MongoCollection objects directly from CakePHP. Tips are provided for replication, indexing, and taking advantage of advanced MongoDB functions.
EP2016 - Moving Away From Nodejs To A Pure Python Solution For AssetsAlessandro Molina
Presents the DukPY project ( https://github.com/amol-/dukpy ) which aims at making possible to run Javascript code and perform common assets transformation steps through the WebAssets framework
Xmla4js is a standalone javascript library that provides basic XML for Analysis (XML/A) capabilities, allowing javascript developers to access data and metadata from OLAP provides for use in rich (web) applications. Xmla4js can be used inside a webpage or in a server environment like node.js
Do you think that HTML is not enough to build a dynamic web application? after reading this presentation I think you will think twice :)
The combination of HTML5, CSS3 and Javascript made it possible, you can develop rich and dynamic web applications that leverages REST web services using JSON and XML, geolocation at your hands, browser friendly and responsive
This document discusses best practices for developing useful APIs. It recommends treating all reusable code as an API and following principles like using minimal dependencies and packaging code appropriately. It also provides examples of API design patterns at the module, class, and method level, such as using dependency injection, builder patterns, and exception handling conventions. The goal is to make APIs easy to read, use, extend, and hard to misuse by learning from open source projects and following trends in API design.
Changing your huge table's data types in productionJimmy Angelakos
This document discusses changing data types for a large production table in PostgreSQL. It describes how to add a new column with the correct data type, copy over the values in batches using a trigger and procedure to avoid locking the table, and then drop the old column and rename the new column. The process takes over 7 hours to complete on a table with 1.7 billion rows but allows the table to remain online and available during the migration.
Writing Mirror API and Native Apps for Google GlassJean-Luc David
The document provides an overview of Google Glass and programming for Google Glass. It discusses the hardware specifications of Google Glass, the Mirror API and programming models for building Glass applications, key features like voice commands and camera support, and includes code examples for different Glass development tasks like cards, notifications, and maps. It concludes by explaining how to purchase Glass and providing contact information for the author.
buy old yahoo accounts buy yahoo accountsSusan Laney
As a business owner, I understand the importance of having a strong online presence and leveraging various digital platforms to reach and engage with your target audience. One often overlooked yet highly valuable asset in this regard is the humble Yahoo account. While many may perceive Yahoo as a relic of the past, the truth is that these accounts still hold immense potential for businesses of all sizes.
Part 2 Deep Dive: Navigating the 2024 Slowdownjeffkluth1
Introduction
The global retail industry has weathered numerous storms, with the financial crisis of 2008 serving as a poignant reminder of the sector's resilience and adaptability. However, as we navigate the complex landscape of 2024, retailers face a unique set of challenges that demand innovative strategies and a fundamental shift in mindset. This white paper contrasts the impact of the 2008 recession on the retail sector with the current headwinds retailers are grappling with, while offering a comprehensive roadmap for success in this new paradigm.
GeoDjango allows you to work with geographic data seamlessly in Django. It adds spatial lookups to the Django ORM so you can query geographic objects by distance and location. Setting up GeoDjango involves installing PostGIS and GEOS libraries, creating a spatial database, configuring Django settings to use the PostGIS database engine, and registering geographic models with GeoManager. The admin site can also be customized to display maps using templates that include Google Maps JavaScript API.
Would you like to make your Android UI code cleaner and more reactive? Android data binding can help. In this talk you’ll learn everything you need to know about data binding, including why it’s so powerful and how to use it effectively. If you haven’t tried data binding in the past, that’s okay! We’ll start with the basics, assuming no prior knowledge and slowly move into more advanced topics, such as 2-way binding, binding adapters, converters, best practices and common pitfalls to avoid.
SH 1 - SES 6 - compass-tel-aviv-slides.pptxMongoDB
This document provides information about writing plugins for MongoDB Compass. It discusses where plugins can fit visually in Compass, including the header, instance tabs, database tabs, collection tabs, and collection heads up displays. It also covers the components that make up a Compass plugin, including React components, stores, actions, and lifecycle hooks. Finally, it walks through an example of creating a simple "whoami" plugin that displays the current user and role by making a connectionStatus database command call.
This document discusses new SQL syntax and query rewrite plugins in MySQL. It introduces FILTER clauses and custom optimizer hints and describes how to implement them using query rewrite plugins. Key points covered include the plugin interface, parsing and rewriting queries, managing memory, and customizing variables. The goal is to add new SQL features and control query execution through simple syntax extensions. Examples of implementing FILTER clauses and custom optimizer hints are provided to demonstrate how rewrite plugins work.
Change tracking is a lightweight solution that provides an efficient change tracking mechanism for applications. Typically, to enable applications to query for changes to data in a database and access information that is related to the changes, application developers had to implement custom change tracking mechanisms. Creating these mechanisms usually involved a lot of work and frequently involved using a combination of triggers, timestamp columns, new tables to store tracking information, and custom cleanup processes.
The document summarizes new features in iOS 7, including updates to the Text Kit framework, customizable view controller transitions, improved support for iCloud integration with Core Data, validating App Store receipts, speech synthesis with AVFoundation, evaluating JavaScript with JavaScriptCore, and new networking APIs for background tasks, AirDrop, Multipeer Connectivity, and iBeacons. The document provides code examples for implementing many of these new features.
EclipseCon-Europe 2013: Optimizing performance - how to make your Eclipse-bas...martinlippert
This document discusses optimizing performance in Eclipse-based tools. It recommends measuring performance using tools like VisualVM and YourKit to identify issues. Common problems include expensive calls in loops and slow builders. Solutions include caching results, reducing garbage collection, and optimizing for common cases. When implementing visitors or type checking, it is important to avoid iterating over collections and make the code simple and fast. Reading bytecode directly is faster than using Eclipse APIs. Reconciling and content assist need to be optimized as they must be fast. Caching and reducing startup workload can improve startup time. The overall approach is to measure, optimize, and repeat.
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
This document provides instructions for minimizing downtime when performing a major version upgrade of PostgreSQL using logical replication with Slony. It discusses various methods for performing the upgrade, including dump/restore, pg_upgrade, and logical replication with Slony. It then provides a step-by-step guide to setting up logical replication between two PostgreSQL nodes using Slony, including initializing the cluster and nodes, creating replication sets, subscribing nodes, and monitoring the initial synchronization process. The document demonstrates how Slony allows performing a graceful switchover and switchback between nodes when upgrading PostgreSQL versions.
Android Lollipop internals and inferiority complex droidcon.hr 2015 Aleksander Piotrowski
Presentation from droidcon Zagreb 2015
While going through JobScheduler internals try to answer the following question: How big is the gap between us and rockstar developers from Google or Square
Internationalizing CakePHP ApplicationsPierre MARTIN
The document discusses internationalization in CakePHP, including:
- Using methods like __() and __n() to translate text strings, and Configure::write() to set the application language.
- The Translate behavior, which allows translating database records into multiple languages and automatically filtering by the current language.
- Generating translation files using the i18n extractor, editing them with POEDIT, and caching translated elements.
The document provides information on various SQL commands used for data manipulation and control, database objects like tables and schemas, users and privileges in SQL. It discusses commands like COMMIT, ROLLBACK, GRANT, REVOKE used for transactions and managing privileges. It also summarizes creation, alteration and deletion of database objects using commands like CREATE, ALTER, DROP and functions like SELECT, INSERT, UPDATE, DELETE for data manipulation. The document further discusses concepts like stored procedures in SQL and use of phpMyAdmin for administering MySQL databases.
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway ichikaway
This document discusses using MongoDB with CakePHP. It covers setting up MongoDB and the CakePHP MongoDB plugin, using MongoDB features like schema flexibility and operators in CakePHP models and controllers, and accessing the MongoDB and MongoCollection objects directly from CakePHP. Tips are provided for replication, indexing, and taking advantage of advanced MongoDB functions.
EP2016 - Moving Away From Nodejs To A Pure Python Solution For AssetsAlessandro Molina
Presents the DukPY project ( https://github.com/amol-/dukpy ) which aims at making possible to run Javascript code and perform common assets transformation steps through the WebAssets framework
Xmla4js is a standalone javascript library that provides basic XML for Analysis (XML/A) capabilities, allowing javascript developers to access data and metadata from OLAP provides for use in rich (web) applications. Xmla4js can be used inside a webpage or in a server environment like node.js
Do you think that HTML is not enough to build a dynamic web application? after reading this presentation I think you will think twice :)
The combination of HTML5, CSS3 and Javascript made it possible, you can develop rich and dynamic web applications that leverages REST web services using JSON and XML, geolocation at your hands, browser friendly and responsive
This document discusses best practices for developing useful APIs. It recommends treating all reusable code as an API and following principles like using minimal dependencies and packaging code appropriately. It also provides examples of API design patterns at the module, class, and method level, such as using dependency injection, builder patterns, and exception handling conventions. The goal is to make APIs easy to read, use, extend, and hard to misuse by learning from open source projects and following trends in API design.
Changing your huge table's data types in productionJimmy Angelakos
This document discusses changing data types for a large production table in PostgreSQL. It describes how to add a new column with the correct data type, copy over the values in batches using a trigger and procedure to avoid locking the table, and then drop the old column and rename the new column. The process takes over 7 hours to complete on a table with 1.7 billion rows but allows the table to remain online and available during the migration.
Writing Mirror API and Native Apps for Google GlassJean-Luc David
The document provides an overview of Google Glass and programming for Google Glass. It discusses the hardware specifications of Google Glass, the Mirror API and programming models for building Glass applications, key features like voice commands and camera support, and includes code examples for different Glass development tasks like cards, notifications, and maps. It concludes by explaining how to purchase Glass and providing contact information for the author.
buy old yahoo accounts buy yahoo accountsSusan Laney
As a business owner, I understand the importance of having a strong online presence and leveraging various digital platforms to reach and engage with your target audience. One often overlooked yet highly valuable asset in this regard is the humble Yahoo account. While many may perceive Yahoo as a relic of the past, the truth is that these accounts still hold immense potential for businesses of all sizes.
Part 2 Deep Dive: Navigating the 2024 Slowdownjeffkluth1
Introduction
The global retail industry has weathered numerous storms, with the financial crisis of 2008 serving as a poignant reminder of the sector's resilience and adaptability. However, as we navigate the complex landscape of 2024, retailers face a unique set of challenges that demand innovative strategies and a fundamental shift in mindset. This white paper contrasts the impact of the 2008 recession on the retail sector with the current headwinds retailers are grappling with, while offering a comprehensive roadmap for success in this new paradigm.
At Techbox Square, in Singapore, we're not just creative web designers and developers, we're the driving force behind your brand identity. Contact us today.
How MJ Global Leads the Packaging Industry.pdfMJ Global
MJ Global's success in staying ahead of the curve in the packaging industry is a testament to its dedication to innovation, sustainability, and customer-centricity. By embracing technological advancements, leading in eco-friendly solutions, collaborating with industry leaders, and adapting to evolving consumer preferences, MJ Global continues to set new standards in the packaging sector.
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.AnnySerafinaLove
This letter, written by Kellen Harkins, Course Director at Full Sail University, commends Anny Love's exemplary performance in the Video Sharing Platforms class. It highlights her dedication, willingness to challenge herself, and exceptional skills in production, editing, and marketing across various video platforms like YouTube, TikTok, and Instagram.
Best practices for project execution and deliveryCLIVE MINCHIN
A select set of project management best practices to keep your project on-track, on-cost and aligned to scope. Many firms have don't have the necessary skills, diligence, methods and oversight of their projects; this leads to slippage, higher costs and longer timeframes. Often firms have a history of projects that simply failed to move the needle. These best practices will help your firm avoid these pitfalls but they require fortitude to apply.
Event Report - SAP Sapphire 2024 Orlando - lots of innovation and old challengesHolger Mueller
Holger Mueller of Constellation Research shares his key takeaways from SAP's Sapphire confernece, held in Orlando, June 3rd till 5th 2024, in the Orange Convention Center.
LA HUG - Video Testimonials with Chynna Morgan - June 2024Lital Barkan
Have you ever heard that user-generated content or video testimonials can take your brand to the next level? We will explore how you can effectively use video testimonials to leverage and boost your sales, content strategy, and increase your CRM data.🤯
We will dig deeper into:
1. How to capture video testimonials that convert from your audience 🎥
2. How to leverage your testimonials to boost your sales 💲
3. How you can capture more CRM data to understand your audience better through video testimonials. 📊
The Evolution and Impact of OTT Platforms: A Deep Dive into the Future of Ent...ABHILASH DUTTA
This presentation provides a thorough examination of Over-the-Top (OTT) platforms, focusing on their development and substantial influence on the entertainment industry, with a particular emphasis on the Indian market.We begin with an introduction to OTT platforms, defining them as streaming services that deliver content directly over the internet, bypassing traditional broadcast channels. These platforms offer a variety of content, including movies, TV shows, and original productions, allowing users to access content on-demand across multiple devices.The historical context covers the early days of streaming, starting with Netflix's inception in 1997 as a DVD rental service and its transition to streaming in 2007. The presentation also highlights India's television journey, from the launch of Doordarshan in 1959 to the introduction of Direct-to-Home (DTH) satellite television in 2000, which expanded viewing choices and set the stage for the rise of OTT platforms like Big Flix, Ditto TV, Sony LIV, Hotstar, and Netflix. The business models of OTT platforms are explored in detail. Subscription Video on Demand (SVOD) models, exemplified by Netflix and Amazon Prime Video, offer unlimited content access for a monthly fee. Transactional Video on Demand (TVOD) models, like iTunes and Sky Box Office, allow users to pay for individual pieces of content. Advertising-Based Video on Demand (AVOD) models, such as YouTube and Facebook Watch, provide free content supported by advertisements. Hybrid models combine elements of SVOD and AVOD, offering flexibility to cater to diverse audience preferences.
Content acquisition strategies are also discussed, highlighting the dual approach of purchasing broadcasting rights for existing films and TV shows and investing in original content production. This section underscores the importance of a robust content library in attracting and retaining subscribers.The presentation addresses the challenges faced by OTT platforms, including the unpredictability of content acquisition and audience preferences. It emphasizes the difficulty of balancing content investment with returns in a competitive market, the high costs associated with marketing, and the need for continuous innovation and adaptation to stay relevant.
The impact of OTT platforms on the Bollywood film industry is significant. The competition for viewers has led to a decrease in cinema ticket sales, affecting the revenue of Bollywood films that traditionally rely on theatrical releases. Additionally, OTT platforms now pay less for film rights due to the uncertain success of films in cinemas.
Looking ahead, the future of OTT in India appears promising. The market is expected to grow by 20% annually, reaching a value of ₹1200 billion by the end of the decade. The increasing availability of affordable smartphones and internet access will drive this growth, making OTT platforms a primary source of entertainment for many viewers.
Implicitly or explicitly all competing businesses employ a strategy to select a mix
of marketing resources. Formulating such competitive strategies fundamentally
involves recognizing relationships between elements of the marketing mix (e.g.,
price and product quality), as well as assessing competitive and market conditions
(i.e., industry structure in the language of economics).
IMPACT Silver is a pure silver zinc producer with over $260 million in revenue since 2008 and a large 100% owned 210km Mexico land package - 2024 catalysts includes new 14% grade zinc Plomosas mine and 20,000m of fully funded exploration drilling.
2. mapmyfitness
+ Founded in 2006
+ Fitness tracking: web and mobile apps
+ 17 million + registered users
+ 123 million routes
+ 156 million workouts
+ We use MongoDB, Postgres, and MySQL
!2
3. MySQL at mapmyfitness
+ Master-Master with Slaves
+ The primary database is “mapmyfitness”
+ MySQL DB has grown from 340 Gb to 500+ Gb in the last year
+ We have some large tables
+ Routes 88Gb
+ Workouts 85 Gb
+ User 17 Gb
4. Schema Changes
+ Add/delete a column
+ Add an index
+ Change a column datatype
+ add/delete a foreign key
+ Move columns around
!4
5. Default MySQL Behavior
+ Create a temporary table with the schema changes
+ Put a table level write lock on the original table
+ Insert “select *” from the original table to the temporary table
+ Rename the temporary table to the original table
+ Drop the original table.
!5
6. A Real World Example:
+ Go for it...during a maintenance window
+ PINGDOM? page down!!!
!6
+ nutrition_foodlog needs a new index
+ 22 million rows
+ File size ~6 Gb
+ 10 minute execution time in a dev environment
7. Shadow Table Migration
+ Essentially the same process as MySQL
+ Create a “shadow” table with the new structure/index
+ Create a stored procedure to copy data
+ Create insert, update and delete triggers
+ Setup and run a batch process to to apply “fake” updates to every
row on the original table
+ Run an atomic rename of the tables
+ Drop the original table, triggers, and stored procedure
!7
8. Create the Shadow Table
!8
+ Create the shadow table with the new index
CREATE TABLE `mapmyfitness`.`nutrition_foodlog_shadow` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`privacy_setting` smallint(6) NOT NULL,
...
KEY `XIE2nutrition_foodlog` (`user_id`, `consume_date`, `id`),
...
) ENGINE=InnoDB AUTO_INCREMENT=38304235 DEFAULT CHARSET=utf8;
9. Create Stored Procedure
!9
DROP PROCEDURE IF EXISTS nutrition_foodlog_update;
delimiter ;;
CREATE PROCEDURE nutrition_foodlog_update(
a_id int(11),
...
a_total_serving_grams decimal(15,7))
BEGIN
INSERT INTO nutrition_foodlog_shadow
SET id = a_id,
privacy_setting = a_privacy_setting,
...
total_serving_grams = a_total_serving_grams
ON DUPLICATE KEY UPDATE
id = a_id,
privacy_setting = a_privacy_setting,
...
total_serving_grams = a_total_serving_grams;
END;
;;
delimiter ;
10. Insert After Trigger
!10
delimiter ;;
CREATE TRIGGER nutrition_foodlog_insert_after_trigger
AFTER INSERT
ON mapmyfitness.nutrition_foodlog
FOR EACH ROW
BEGIN
CALL nutrition_foodlog_update(
new.id,
new.privacy_setting,
new.privacy_limit_list,
new.user_id,
new.meal_type_id,
new.consume_date,
new.serving_count,
new.food_id,
new.updated_date,
new.created_date,
new.serving_id,
new.total_serving_grams);
END;
;;
11. Update Before Trigger
!11
delimiter ;;
CREATE TRIGGER nutrition_foodlog_update_before_trigger
BEFORE UPDATE
ON mapmyfitness.nutrition_foodlog
FOR EACH ROW
BEGIN
CALL nutrition_foodlog_update(
new.id,
new.privacy_setting,
new.privacy_limit_list,
new.user_id,
new.meal_type_id,
new.consume_date,
new.serving_count,
new.food_id,
new.updated_date,
new.created_date,
new.serving_id,
new.total_serving_grams);
END;
;;
12. Delete After Trigger
!12
delimiter ;;
CREATE TRIGGER nutrition_foodlog_delete_after_trigger
AFTER DELETE
ON mapmyfitness.nutrition_foodlog
FOR EACH ROW
BEGIN
DELETE FROM mapmyfitness.nutrition_foodlog_shadow
WHERE id = old.id
LIMIT 1;
END;
;;
13. “Fake” Updates
!13
select concat('update mapmyfitness.nutrition_foodlog set id = ',
id,
' where id = ',
id,
' limit 1;') as seql
from mapmyfitness.nutrition_foodlog
order by id;
update mapmyfitness.nutrition_foodlog set id = 2 where id = 2 limit 1;
update mapmyfitness.nutrition_foodlog set id = 4 where id = 4 limit 1;
update mapmyfitness.nutrition_foodlog set id = 6 where id = 6 limit 1;
update mapmyfitness.nutrition_foodlog set id = 8 where id = 8 limit 1;
update mapmyfitness.nutrition_foodlog set id = 12 where id = 12 limit 1;
update mapmyfitness.nutrition_foodlog set id = 14 where id = 14 limit 1;
update mapmyfitness.nutrition_foodlog set id = 16 where id = 16 limit 1;
update mapmyfitness.nutrition_foodlog set id = 20 where id = 20 limit 1;
14. Rename of Tables
!14
-- rename the tables
-- RENAME TABLE table1 to table1_old, table1_shadow to table1;
RENAME TABLE mapmyfitness.nutrition_foodlog
to mapmyfitness.nutrition_foodlog_old,
mapmyfitness.nutrition_foodlog_shadow
to mapmyfitness.nutrition_foodlog;
+ Should be an atomic operation
+ All tables get renamed or none get renamed
+ Run it as one statement
15. Clean-up
+ After confirming all is good with the new table clear the cruft!
!15
-- drop triggers
DROP TRIGGER IF EXISTS nutrition_foodlog_update_before_trigger;
DROP TRIGGER IF EXISTS nutrition_foodlog_insert_after_trigger;
DROP TRIGGER IF EXISTS nutrition_foodlog_delete_after_trigger;
-- drop the update stored procedure
DROP PROCEDURE IF EXISTS nutrition_foodlog_update;
-- truncate and drop the "old" table
TRUNCATE TABLE mapmyfitness.nutrition_foodlog_old;
DROP TABLE mapmyfitness.nutrition_foodlog_old;
MySQL is where all of our meta data is stored, like user profile data, route ids, start and stop points, workout duration, calories etc. We use master-master with slaves replication topology, but only write to one server. The second master is a hot failover and a member of the read array. Slave read array of 5 additional servers connections are managed through haproxy Split out reads and writes: 97% read 3% writes: 4000 reads per second vs 150 writes per second mapmyfitnes db: In the year and a half that I’ve been working at MMF it’s grown from 340 Gb to ~500 Gb: add about 30-40k new registered users every day add about 300-400k workouts per day add about 250-350k routes per day large denormalized wide tables: user, workout, route, nutrition_foodlog Many of these tables have multiple single column indexes, few have compound indexes that might give the mysql optimizer a better query plan to get the results of those 4000 qps back to the users faster. These stats are approximate since they are from the information_schema tables. table_name rows size_Mb route 123754906 88496.3 workout 161760035 85441.8 user 16580651 16681.0 nutrition_foodlog 22167873 5974.5 auth_user 16882244 5368.2
This applies to v5.1 and v5.5. v5.6 is a little different. The problem here is the table level lock: how long does it last, how much will other activities on the DB get impacted by this lock and it’s duration The second problem is replication: once this completes on the master it gets run on a slave and continues downstream, affecting each slave for ~ the same duration.
File size only 6 Gb, we should just go for it during a maintenance window. Let’s test on a dev environment. tested...works. That didn’t work. I was running innotop in another window and as soon as I kicked this operation off the screen turned red and insert/updates/and deletes to the nutrition_foodlog table were piling up in innotop. well that was to be expected. The our nginx and uwisgi latency alerts started firing...PINGDOM! page down...time to kill the transaction and go back to the drawing board.
Do the same process that MySQL does but with less impact to running applications and replication Create the shadow table: new table structure, added indexes, added/removed columns FKs, etc The update stored proc inserts a row into the shadow table from the original table insert trigger, fire on insert: calls the update stored proc to insert the “new” row to the shadow table update trigger, fire on update: calls the update stored proc to insert the “new” column values to the shadow table delete trigger, fire on delete: just delete the row from the shadow table if it exits. The batch process, just updates the primary key value to the same value, but it kicks off the update stored proc to copy the original row to the shadow table. This is how all of the old rows get moved to the new structure. The atomic rename is basically running two table renames in the same transaction so they happen all at once or not at all.
One thing to note: since you are creating a stored procedure to handle these inserts you can do much more then just copy the data, you can do validation, check for duplicates, split the data into multiple tables, etc.
These updates just trigger the update stored procedure to copy the data from the original table to the shadow table. You can just do it in a script, or put the sql into a table and select from it...however you feel comfortable running them. I output these to files containing 100k updates per file and ran those with a 3 second sleep between each batch of 100k. That was so that I could kill/stop the process easily and it also throttles the update statements to the server so that replication can keep up.
If something goes wrong you can rename the tables again and apply any missing transactions from the bin log.