Multiprocess simple storage for Ruby program

  • Thread starter Deleted member 43669
  • Start date
Status
Not open for further replies.
D

Deleted member 43669

Guest
I don't have strong ACID requirements, although on normal conditions I wouldn't like to lose data.

I can accept data loss if there are hard failures.

The process will have about ~100 (smallish writes, 100 bytes or less) writes per 30s or something like that, though it would be nice if we could do something like 1000 writes or more.
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
Batching that little data seems very silly unless whatever the consumer does is absurdly expensive.

If you really can't have the consumer process running all the time (which is silly), then use a database or messaging server. At anyrate, the basic concept of having the consumer save off data before doing any processing (whether it does it now or later) is sound, even if you don't want to do it.

Moreover, I'd just do whatever's easiest, as you don't have any specific requirements here. You could possibly have something basic working already if you'd just made an arbitrary decision and gone with it. You haven't said anything that suggests anything about this decision matters at all.
 
D

Deleted member 43669

Guest
Potentially we can have 20.000 nodes sending information to the central server. In my original post I said 100 writes/30s, so that would be 4.000.000 writes/minute to the central server.

Sounds doable, but batching the writes on the nodes sounds like a good way to easily reduce overhead and it's not a big problem for us (we can deal with increased latency).
 

LordHunter317

Ars Legatus Legionis
22,394
Subscriptor
100 writes/30s is only 3.3 writes/s, at 100 bytes/write is 330 bytes/s. That's serial line speed. At 20k nodes you're looking at 6.3 MiB/s. Your biggest problem is the 20K concurrent connections to the central messaging server. That's probably easiest to solve with distributed / clustered MQ servers, which just about all implementations support to varying degrees.

If you want to reduce the number of connections from a single machine, then create a process to talk to the MQ server directly, and use a local IPC mechanism to talk to that process. That said, unless you're talking 100s of processes per server, you're probably not going to save enough connections to avoid a distributed MQ server[1].

Unless your concern is a record might be lost while waiting in sender process, there's no obvious reason to do anything else. Even then, then simplest way to save them for disk to send to another server later is to run a local MQ server doing store-and-forward.

Batching doesn't obviously help anything here, and it creates a lot of attendant complications.

[1] Ignoring the other reliablity aspects of sending everything to a single destination.
 
Status
Not open for further replies.