SLIDE 1
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 - - 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
SLIDE 2
SLIDE 3
The Offline Problem
MySQL Apache + PHP PHP Files
SLIDE 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
SLIDE 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
SLIDE 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
SLIDE 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
SLIDE 8
What We Need
- Built-in HTTP server
- HTTP
- SOAP
- It is a database
- External Environments:
- PHP
- Perl
- .NET
- Java
- C (external libraries)
SLIDE 9
Stand-Alone Application
MySQL Apache + PHP PHP Files
SQL Anywhere PHP PHP Files
SLIDE 10
What We Need Cont.
- Built-in synchronization
- MySQL
- Oracle
- MS SQL Server
- IBM DB2
- SQL Anywhere
- Sybase ASE
SLIDE 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
SLIDE 12
Adding MobiLink
MySQL Apache + PHP PHP Files
SQL Anywhere PHP PHP Files
MobiLink Server
SLIDE 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
SLIDE 14
Sync!!
MySQL Apache + PHP PHP Files
SQL Anywhere PHP PHP Files
MobiLink Server Client Sync Server
SLIDE 15
Syncing Files
MySQL Apache + PHP PHP Files
SQL Anywhere PHP PHP Files
MobiLink Server Client Sync Server
Offline PHP Files
SLIDE 16
Storing Files in the Database
MySQL Apache + PHP PHP Files
SQL Anywhere PHP PHP Files
MobiLink Server Client Sync Server
Offline PHP Files
SLIDE 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
SLIDE 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)
SLIDE 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