Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Replicated datastore

74 views
Skip to first unread message

Tiago Malhadas

unread,
Oct 2, 2023, 2:00:20 PM10/2/23
to Service Weaver
Hi, I want to use service weaver to implement a distributed system where different replicas of the same component access different datastores. Is it possible? And if it is, how can I do it?

mwhittaker

unread,
Oct 2, 2023, 3:56:32 PM10/2/23
to Service Weaver
Hi Tiago, 

Good question. Do you mind elaborating a bit on what you're trying to accomplish? 

Technically, different replicas of a component can access different data stores. However, there's a number of restrictions that make it hard to do this in a useful way. For example, there isn't a fixed number of replicas, there's no way to pass different configuration to different replicas, replicas are not assigned unique names, etc.

Best,
Michael

Srdjan Petrovic

unread,
Oct 3, 2023, 11:37:56 AM10/3/23
to mwhittaker, Service Weaver
To add to what Michael said: you should be able to do absolutely everything you can do today in, say, Kubernetes, using Service Weaver. While we try to do things like increasing the number of replicas automagically for you, you can absolutely disable this behavior and fix the number of replicas and/or use Kubernetes StatefulSets for example.

Roughly, Service Weaver aims to solve two problems:
  1. Make distributed systems easier to write, e.g., don't write RPC code, don't worry about versioning, use language-native types.
  2. Make distributed systems easier to deploy and manage.

If you prefer to preserve your existing deployment and configuration flow, you can still get tons of benefits from (1), and not rely on Service Weaver to handle (2) for you above.

As Michael said, there is 100% a way to achieve what you want even if replicas are dynamically scaled up and down, but in your case it may make sense to not rely on this Service Weaver behavior and fix the number of replicas yourself. 


--
You received this message because you are subscribed to the Google Groups "Service Weaver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to serviceweave...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/serviceweaver/9f2f8fc1-300b-4e1f-b42c-d26d64483339n%40googlegroups.com.

Ged Wed

unread,
Jan 2, 2024, 11:48:52 AM1/2/24
to Service Weaver
Pocketbase and Marmot provides a distributed DB that works easily with Weaver.

https://github.com/pocketbase/pocketbase provide s DB with lots of extra stuff.

https://github.com/maxpert/marmot scales out the DB as a Master / Master DB with eventual consistency using NATS Jetstream

with the new SSH deployer its even easier to deploy not Fly.io 

Just ask if you need more info...

Gerard
Reply all
Reply to author
Forward
0 new messages