Skip to content

halfer/Meshing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meshing
-------

INTRODUCTION

Purpose: A decentralised, peer-to-peer layer for relational databases.
License: Open source, specific licence to be decided.
Language: PHP5.2
Platform: Unix-like platforms, Linux, Mac. Probably Windows, but not tested.
User interface: Command line for the prototype, web tools to be devised later.
Database: Anything supported by Propel 1.6. At least MySQL, PostgreSQL, and likely others.
Say hey to: Jon <projects.ws {at} jondh.me.uk>

Learn about it here:

http://blog.jondh.me.uk/meshing

GETTING STARTED

Here's how to run the demo. Unpack the tarball (or from git) on a server, and cd to that folder.
You should be able to run this command to get a list of commands:

	./meshing

If you run into trouble, make sure at least PHP5.2 or 5.3 is installed on your system, via this:

	php -v

OK, so assuming that the command list has worked for you, create an empty database on your target
platform, and set up user credentials to access it. Edit /database/system/build.properties so
your connection details are set up for your platform:

	# Database driver
	propel.database = pgsql

	# Connection details
	propel.database.url = pgsql:host=localhost dbname=meshing_system user=jon password=
	propel.database.user = jon
	propel.database.password = password

** Note: some example commands to work with the system are detailed below. You can alternatively
** run ./demos/jobs.sh which will do all of this for you.

Then run the following command to build the system tables:

	./meshing system:build --database --verbose

Be careful with this command generally; the '--database' flag clears the whole of the system
database, so don't do this on an existing installation!

OK, hopefully that went OK. Now let's create a schema definition, and for speed we'll use an
existing example: a jobs database. Run the following:

	./meshing schema:add --name jobs --name demos/jobs.xml

That command will have added the schema to the installation folder, inside
database/schemas/jobs/schema.xml - plus some automatically-added primary keys and other
metadata columns. It will also set up model classes in database/models/jobs/.

Next, we'll need a new database connection for our node, so create one in your database now. In
theory you can use the same one as before, but to keep node tables separate from system tables,
it is a good idea to have a separate one. Add that thus:

	./meshing connection:add \
		--name conn_jobs_1 --adaptor pgsql --host localhost \
		--user jon --password mypass \
		--database mydb

Of course, change the values to fit your situation (e.g. if you're using MySQL then specify 'mysql'
as the adaptor). If you wish you can also supply --test to try the connection at the same time.

Now that these basic items are set up, we can create a node:

	./meshing node:add --name node_jobs_1 --connection conn_jobs_1 --schema jobs

This will build an instance of the "jobs" schema in the specified database. If there is an instance
of this schema in the database already, it will throw an error, and if you are sure you wish to
overwrite it, you must use the --force flag.

(Next steps are to run trust:add and node:start, yet to be written).

About

CLI and web tools to set up decentralised, peer-to-peer databases (work in progress, on hold)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published