Fork me on GitHub
#datomic
<
2017-05-02
>
Matt Butler11:05:17

Hi 🙂, How are people doing Datomic Backups on AWS? Anyone managed to get it to work with Lambda?

Lambda/Sierra13:05:23

@mbutler I had a successful proof-of-concept of a scheduled AWS Lambda launching a short-lived EC2 instance to run the Datomic Backup.

Matt Butler13:05:11

@stuartsierra This was what i assumed would be necessary (rather than being able to run the backup directly in a Lambda), how were you letting Lambda know that the backup was complete (http req maybe)? Any pitfalls I should be aware of? Or is it as simple as Trigger Lambda to bring up box with S3 access, make sure datomic files present on instance, run backup, trigger lambda to kill box.

robert-stuttaford13:05:07

@mbutler we have a small ec2 instance running backups continuously

pesterhazy13:05:02

I have Jenkins task that makes the backup

pesterhazy13:05:25

Remember backups are strictly incremental so can be run very frequently with little harm

Matt Butler13:05:07

Yes, had also considered running from an application server, just seemed that Lambda might be a nice solution. however the extra step of launching and managing an instance makes it a little less appetising.

robert-stuttaford13:05:06

don’t run backups from an app server. it’s a java process, it’ll eat all your ram 🙂

Matt Butler13:05:25

Allowances had been made for the extra RAM usage but I agree its a messier solution. 🙂

robert-stuttaford13:05:49

i’m fairly certain that the cost of an ec2 instance doing continuous backups will be less than the DDB read spikes you’d see by doing bigger infrequent backups. i have no actual facts to back this up

pesterhazy13:05:53

beause of ec2's hourly pricing, spinning up ec2 instances doesn't make a lot of sense to my mind

pesterhazy13:05:02

you might as well keep one going continuously

Matt Butler13:05:33

I confess from a practical standpoint I'm inclined to agree @robert-stuttaford, Lamda just seemed like the right solution for a "backup" job.

pesterhazy13:05:16

(now if only aws introduced by-second billing for long-running tasks, that'd be a game changer)

Matt Butler13:05:27

@pesterhazy Doesn't hourly pricing incentive's the launching/killing of EC2 instances?

pesterhazy13:05:44

only if you back up less than once an hour 🙂

Matt Butler13:05:40

I suppose with the incremental backup, there's an argument for smaller windows, point well made 🙂

robert-stuttaford13:05:43

we do it continuously because AWS. don’t want to be at the mercy of DDB being down in that region and our business coming to a halt

robert-stuttaford13:05:53

we’re not in US-EAST-1 but still

Matt Butler13:05:34

Great points, thanks 🙂

Lambda/Sierra14:05:43

@mbutler I think I had the Lambda launch the instance, then the instance destroy itself when it was done.

Matt Butler14:05:27

Gotcha 🙂

eraserhd17:05:22

I have a weird problem. I'm trying to transact with a single, pretty simple datom, and am getting :db.error/not-a-data-function.

eraserhd17:05:24

I first tried with (d/transact (conn) [[<eid> :my/attr "value"]]), then with (d/transact (conn) [[<lookup-ref> :my/attr "value"]])

eraserhd17:05:51

Both times it complains that the value which is not a data function is the eid of the thing I'm updating.

eraserhd17:05:58

(so it resolved the lookup ref).

eraserhd17:05:33

Oh, god. :db/add.

eraserhd17:05:37

hahaha. Ignore me.

pesterhazy17:05:42

That one has bitten me a few times as well