Coder Social home page Coder Social logo

ecraft / couchdb_to_sql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samlown/couch_tap

2.0 2.0 0.0 106 KB

CouchDB to SQL synchroniser. Listens to _changes feed and automatically inserts or updates records.

License: MIT License

Ruby 100.00%

couchdb_to_sql's People

Contributors

afinne avatar auroranockert avatar perlun avatar samlown avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

couchdb_to_sql's Issues

Make tests pass again

The problem right now is that the latest changes done by @afinne are Postgres-only, since they use UPSERT etc, which is not available in SQLite.

Either we:

  • make the code handle both scenarios, with if-statements or similar, or
  • change Travis to use Postgres for its test runs.

Make it possible to run the tests on JRuby as well as MRI

Since #8, we support JRuby, but our test suite can only run on MRI because of dependencies on sqlite.

This issue exists to remind us to fix this. On JRuby, we should probably use H2, Derby or some similar database, with a low number of dependencies.

This gem is all we need to get running with Derby. It seems to quite popular, and there is a Sequel adapter for it. My take would be that we start with this one and see if we can get it working reasonably easy.

Rename gem to couchdb_to_sql

Since our gem has significant changes from the original couch_tap implementation, we (me and @afinne) discussed and decided to rename it to couchdb_to_sql - a name which clearly tells what it does, and also clearly distinguishes it from @samlown's great original work, from which we are derived.

The module name will be CouchdbToSql, in line with Rubygems: Name your Gem

Perform SQL insertions in bulk

At the moment, SQL inserts are being performed one row at a time. This has significant performance impacts. We should look into changing this to use Sequel's great multi_insert support to speed it up.

One of the challenges here is that we receive the data from CouchDB in very small chunks (6 rows per chunk). I wonder if that could be tweaked somehow...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.