swarm icon indicating copy to clipboard operation
swarm copied to clipboard

porting from a backbone app

Open 0xgeert opened this issue 11 years ago • 5 comments
trafficstars

I currently have a fullblown backbone app. How would I go about integrating Swarm while keeping most of the app intact? Could swarm for instance be used (with some modification to my app) to replace Backbone.sync?

BTW: backend is on Node (Loopback which sits on top of regular Express)

0xgeert avatar Oct 15 '14 08:10 0xgeert

Hi! Swarm was modeled along the lines of Backbone, so the semantics is similar. Still, Swarm is far from being a drop-in replacement. In your case, there is no server-side support (Loopback has no Swarm server on their side). It is still possible to run Swarm alongside backbone, in case you run your own server-side instance.

gritzko avatar Oct 16 '14 11:10 gritzko

Currently highly customizing Loopback to update model instances (of 1 particular model) using events in an eventsourcing architecture. This feels a bit similar to how Swarm updates things if I'm not mistaken? Cheers

0xgeert avatar Oct 16 '14 17:10 0xgeert

Exactly. We call it "partially ordered log of immutable events", but "event sourcing" is also a very correct description of what is happening.

gritzko avatar Oct 16 '14 18:10 gritzko

By the way, you may play with the Backbone adapter: https://github.com/swarmjs/swarm/commit/a71819cbb4907e5af0628f22953a6f900c88b7b0 Very preliminary, please share any thoughts.

gritzko avatar Nov 16 '14 11:11 gritzko

Looks like a good start, may have a try / poc soonish.

As a general question: since I'm currently implementing an eventsource solution (probably using Kafka as eventsource, although actively considering SSDB at the moment as a poor man's alternative), I can't help but notice the overlap in general architecture: i.e.: writing to a tail of a log, which is consumed at some time, etc.

Considering this, may I suggest looking at the following usecases if you haven't done so already?

  • being able to replay the eventsource/log
  • being able to have multiple consumers on the log, which each save their offset marking up to which operation they have processed
  • being able to partition the log (some custom json.property or function return value), which would allow for client orchestrated sharding

I feel these would be awesome features, which might nicely fit/extend what Swarm wants to be. Thoughts?

On Sun, Nov 16, 2014 at 12:42 PM, Victor Grishchenko < [email protected]> wrote:

By the way, you may play with the Backbone adapter: swarmjs/swarm@a71819c https://github.com/swarmjs/swarm/commit/a71819cbb4907e5af0628f22953a6f900c88b7b0 Very preliminary, please share any thoughts.

— Reply to this email directly or view it on GitHub https://github.com/gritzko/swarm/issues/25#issuecomment-63216172.

0xgeert avatar Nov 16 '14 20:11 0xgeert