taking it all offline with sql anywhere
play

Taking it all Offline with SQL Anywhere Eric Farrar, Product Manager - PowerPoint PPT Presentation

Taking it all Offline with SQL Anywhere Eric Farrar, Product Manager Sybase iAnywhere March 5, 2009 Simple MySQL and PHP Blog Apache MySQL + PHP PHP Files The Offline Problem Apache MySQL + PHP PHP Files The Offline Problem Why


  1. Taking it all Offline with SQL Anywhere Eric Farrar, Product Manager Sybase iAnywhere March 5, 2009

  2. Simple MySQL and PHP Blog Apache MySQL + PHP PHP Files

  3. The Offline Problem Apache MySQL + PHP PHP Files

  4. The Offline Problem  Why not user Gears?  App must be written in JavaScript  No PHP code reuse  Lack of encryption, security, strict referential integrity, etc  How do you sync?  What do we need to host an offline version of the application?  Web Server  Database  PHP installation  Synchronization

  5. Enter SQL Anywhere  SQL Anywhere is an enterprise caliber, full-featured, SQL relational database  Sybase SQL Anywhere ≠ Sybase ASE  Over 15 years old, over 10 million deployed seats  Roots in the embedded and mobile space  Supports  10 Mb footprint  1 user  1000s of users  1 Mb  100s of Gbs

  6. A Full-featured Database • Consistent focus on ease of use, self-administration, and self tuning • Rich security and data integrity features • Features include: • Built-in full-text indexing • Snapshot isolation • Immediate refresh materialized view • Supports multiple SQL dialects • Built-in HTTP server • Both producer and consumer • Email support • Profiling and monitoring

  7. SQL Anywhere and PHP  Newly re-written module for PHP  API based off of the mysql API  sasql_<FUNCTION NAME>()  Supports:  Prepared statements  Stored procedures with INOUT parameters  Multiple-result sets

  8. What We Need  Built-in HTTP server  HTTP  SOAP  It is a database  External Environments:  PHP  Perl  .NET  Java  C (external libraries)

  9. Stand-Alone Application PHP Apache MySQL + PHP SQL Anywhere PHP Files PHP Files

  10. What We Need Cont.  Built-in synchronization  MySQL  Oracle  MS SQL Server  IBM DB2  SQL Anywhere  Sybase ASE

  11. MobiLink and Synchronization  MobiLink acts as a ‘sync server’  Makes a regular database connection to consolidated database  Handles all synchronization traffic  Set up in farms to scale out (> 100,000 syncing remotes)  Write sync scripts to handle business logic of sync  SQL (native dialect of consolidated database)  .NET  Java  Conflicts detected at column or row level

  12. Adding MobiLink PHP Apache MySQL SQL + PHP Anywhere PHP Files PHP Files MobiLink Server

  13. Client Sync (dbmlsync)  Uploads all changes to database since last sync  All synchronization happens in a SINGLE transaction  Any failures will cause a full rollback  Sends both current value, and original synced value of rows  Can be run on demanded, or scheduled

  14. Sync!! PHP Apache MySQL SQL + PHP Anywhere PHP Files PHP Files Client Sync Server MobiLink Server

  15. Syncing Files Offline PHP Files PHP Apache MySQL SQL + PHP Anywhere PHP Files PHP Files Client Sync Server MobiLink Server

  16. Storing Files in the Database Offline PHP Files PHP Apache MySQL SQL + PHP Anywhere PHP Files PHP Files Client Sync Server MobiLink Server

  17. A Digression  What if I want to sync to a smaller device than the SQL Anywhere supports?  UltraLite  Very small footprint (~600k)  Runs on many more platforms including Blackberry (UltraLiteJ) and embedded Linux  Supports all the same change tracking and built-in synchronization as SQL Anywhere  Very suitable as browser-local database

  18. SQL Anywhere as a Server  While this example has used SQL Anywhere as the remote, SQL Anywhere can also be used as the server in a traditional way  SQL Anywhere: The Web Edition  Intended for browser-based applications  Fully tested  No limits on scale, processing power, or query planning  Windows, Linux and Mac OSX (coming soon)

  19. Where to get more information  SQL Anywhere Web Forum  http://groups.google.com/group/sql-anywhere-web-development/  My Blog – “Peering Behind the Browser”  http://iablog.sybase.com/efarrar  SQL Anywhere PHP Module page  http://www.sybase.com/detail?id=1019698

Recommend


More recommend