Using jugglingdb to write same data to multiple dbs

30 views
Skip to first unread message

sh...@activelement.com

unread,
Apr 21, 2014, 3:55:07 AM4/21/14
to compo...@googlegroups.com
Hi, I have 2 dbs one in redis and another in postgres

so when i create a user in postgres i want to create the same in redis as well.
Is that possible in Juggling with a single create function all?

regards
Abhishek

Anatoliy Chakkaev

unread,
Apr 21, 2014, 7:12:43 AM4/21/14
to compo...@googlegroups.com
Hi Abhishek,

Yes it is possible if you use afterCreate hook in your model in postgres to create another user model in redis.

Alternatively on adapter level you can use 'backyard' pattern for redis-hq (implemented with mysql now). This pattern allows you fully mirror any data on your redis database with mysql database.

Cheers,
Anatoliy


--
The official community of CompoundJS.
 
website: compoundjs.com
source: https://github.com/1602/compound
bug reports: https://github.com/1602/compound/issues?state=open
---
You received this message because you are subscribed to the Google Groups "CompoundJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to compoundjs+...@googlegroups.com.
To post to this group, send email to compo...@googlegroups.com.
Visit this group at http://groups.google.com/group/compoundjs.
For more options, visit https://groups.google.com/d/optout.

sh...@activelement.com

unread,
Apr 22, 2014, 2:29:39 AM4/22/14
to compo...@googlegroups.com, ma...@anatoliy.in
Thanks for the info Anatoliy, 

i will use the aftercreate hook

Ramsey D'silva

unread,
Apr 26, 2014, 10:52:19 PM4/26/14
to compo...@googlegroups.com, ma...@anatoliy.in
Can we use postgres as backyard database as well?

Anatoliy Chakkaev

unread,
Apr 27, 2014, 8:42:21 AM4/27/14
to compo...@googlegroups.com
Yes, probably. I haven't tried.
Reply all
Reply to author
Forward
0 new messages