interledger / interledger-rs

An easy-to-use, high-performance Interledger implementation written in Rust
http://interledger.rs
Other
201 stars 70 forks source link

PostGres store backend #474

Open bstrie opened 5 years ago

bstrie commented 5 years ago

Breaking down this task into more manageable goals:

emschwartz commented 5 years ago

abstract redis-specific logic out of ilp-node

I wouldn't work on much abstraction here. Instead, I would replace these lines with a method on the node called connect_to_store or something like that. That method would parse the database_url parameter to see whether it's a redis, redis+unix, or sqlite URL and use the appropriate builder to create and connect to the store. That method would return an impl Future<Item = ..., Error = ()> where ... is a thing that implements all the store traits.

dynamically determine whether to instantiate a prior existing node or a new node based on whether the sqlite file already exists (or configuration parameter, for use with redis as well?)

This should only be necessary if the SQLite store does anything to create the tables on startup. If the tables are created dynamically when they're used, its behavior would be the same whether you gave it a path to a file that didn't yet exist or one a path to a previously used database.

KevinWMatthews commented 5 years ago

Is this happening on a branch somewhere? I'm curious to watch these changes take shape.

bstrie commented 5 years ago

@KevinWMatthews I haven't pushed any of my WIP commits yet, but I'll try to get something up today that people can look at.

bstrie commented 5 years ago

@KevinWMatthews I've got the initial groundwork laid in https://github.com/interledger-rs/interledger-rs/issues/474.

sappenin commented 4 years ago

@bstrie Any updates here?

gakonst commented 4 years ago

Given that we haven't had any progress on this, we decided with @sappenin to move forward with PostGRes and tokio-postgres for this task

sappenin commented 4 years ago

In Java we have all account-related data stored in Postgres (only balance tracking is still persisted in Redis). I suggest we replicate the DDL that we have in the Java project here. See here for the table structure used by the Java Connector.