I am creating a website based on rails which uses a database based on mysql. I want my website to be available offline. For that I have to store the database on client's machine. I have the option on Web storage, Web sql database, Indexed DB. I have decided to use Wed sql database which is implemented using SQLite. I want the two database to be synchronized whenever the user is online. Please let me know how to make this possible
Using web sql database
1k Views Asked by rdp At
2
There are 2 best solutions below
0
umbrae
On
You may want to look into persistence.js for this, particularly the sync plugin. It works well for simple cases. (I'm not sure how much data you're planning on storing or how complex it is.)
As a bonus, it's abstracted out, so you can use Web SQL now and if, down the line, IndexedDB becomes the better option, it should be less painful to switch backends.
Related Questions in MYSQL
- MySQL Select Rank
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Push mysql database script to server using git
- Why does mysql stop using indexes when date ranges are added to the query?
- Google Maps API Re-size
- store numpy array in mysql
- Whats wrong with this query? Using ands
- MySQL-Auto increment
- show duplicate values subquery mysql
- Java Web Application Query Is Not Working
- microsoft odbc driver manager data source name not found and no default driver specified
- Setting foreign key in phpMyAdmin
- No responses from google places text search api
- Adding to MAMP database in SQL/PHP
- I want to remove certain parent- and child-divs in all my wordpress posts with php or some other script
Related Questions in SQLITE
- How to insert values into Android SQLite Database?
- Inserting and returning autoidentity in SQLite3
- sqlite3 select statement fails with "parameters are of unsupported type
- Android database query not returning any results
- No such column error when column does exist
- Can't insert " character into Sqlite DB [Objective-C]
- How do I Insert a Previously Created SQLite Database into a Xamarin.Android App?
- Clearing database for emulator app so it acts like being run for the first time?
- SQLite UPDATE statement updates all row in table
- ActiveResource::ResourceNotFound: Failed. Response code = 404. Response message = Not Found
- Syntax error in rails database query
- Deleting and Updating values from a cusrsor adapter
- restrict sqlite-wal and sqlite-shm from icloud backup
- Recieveing Null Pointer Exception when trying to retrieve data from SQL database to listview android
- Scraping blog and saving date to database causes DateError: unknown date format
Related Questions in RUBY-ON-RAILS-3
- Jruby: How to use third party java library?
- How do I update create route from rails 3 to 4
- Can't update user in Ruby on Rails
- Rails Ancestry. How can I display a single comment with all its descendants?
- LinkedIn API returns Positions without Title
- Catch emails to all [email protected], and execute code
- Cannot run elastic search in circleci to make my rspec for elasticsearch to pass?
- How do I clear values from text_field_tag after browser refresh?
- Rails submit create action succeeding
- f.select with enum in rails 3
- Rails 3 join where query - print only on row
- Rails testing button functionality with capybara.
- Fix spurious rspec "photo can't be blank" failures for Carrierwave
- ActiveRecord Slow Object Instantiation
- Ruby on Rails 3 Multiple Associations
Related Questions in OFFLINE-BROWSING
- Javascript database on browser hard-drive
- how to handle the data downloading in background dispatch queue from server if battery drains?
- How to Check that how much offline storage has been Used
- Using web sql database
- Can the new HTML5 manifest.cache file contain paths to directories?
- Using offline storage
- HTML Offline Application Cache, Listing Downloaded Files
- HTML Offline Application Cache, Getting Error Details
- Force rack-offline (or Rails) to update caching manifest
- IE 10 not using AppCache after browser closed
- Wrapper to support both webSql and indexedDB?
- Website that runs without Internet?
- HTML 5 offline storage cache manifest not working for mobile
- html5 offline application on multiple platform
- Building an Offline web app for Chrome browser
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The only way I can see this happening is for your clients to install local copies of some kind of DBMS like SQLite. You can then write to the local database from your site, although this may take more finagling.
As far as synchronization, I would synchronize via last-modified time, location, or client, as per your needs. If you use time, make sure you standardize (with UTC for example) to avoid problems with local system times.