rdbms as backend

Marcin Krol mrkafk at gmail.com
Tue Jul 30 12:58:19 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

This is a peculiar topic that I think goes beyond typical use of
varnish so I post it here.

At my company we have a need peculiar sort of infrastructural subsystem:

- - HTTP requests are done to find if smth is cached
- - RDBMS (mysql, oracle) backends
- - Other subsystems as backends

Clients use unified protocol based on (simple) http requests to get
their data. (it's for this reason that we do not use caches built into
rdbms directly, as well as we do not want to do tight coupling of a
particular client to a particular rdbms or subsystem)


Either we write the whole thing ourselves or we use smth else like
varnish.


I like the thought of using varnish, although I'm not sure if it this
is not shoehorning it into such role. However, when it comes to
caching, load balancing, failover and cached HTTP results serving it's
ideal in such role.

The only problem is backend. Essentially, what we need is e.g. for
mysql backend:

on cache miss:

- - connect to mysql

- - run the query we received in GET/POST/whatever

- - JSONIFy result (query results are not big in our application,
limited size of the result is a tolerable limitation for us)

- - cache result, return it


on cache hit:

- - retrieve from cache, return it


(and so on for other backends)


Is this feasible? Is it even sane? Should I use smth else maybe?

Essentially, what we need are pluggable, modular backends. (obviously
we can handle writing the part that transforms particular backend
response into HTTP response, the snag is how to plug this correctly
into backend usable by varnish)

I was thinking about using VMODs but none of the modules available
seem to meddle with backends themselves somehow.


Thanks!
MK

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJR95xLAAoJEFMgHzhQQ7hOXOYH/2QZgry4O55fRvvEE0I9tPnw
xLCXV/snfnH2jawW01sFDZ87JV3S9s10bqSoqTs21vMkd7M+hHsp3I/wKTg2dwqR
kQ0M9p2aPiLyijI7v6FCcpaorL10wZ0/12i6A+RnsyPLN2FDeDpCCDeB0oVNauqc
K/yE2lfsAvVu+jxlmzygePlV9ZZ+B455G8GFIIvN+S10QFly1rAOLbCg7Mi1KRq9
4BYPsISZnYDIbAUKjQWLQDmfhoXfbgIZQJMLzIJFiQC2+G1WFIVp94Z5JRsVQlHm
PcIx3Gt0zq5Qd198+97qTDZLPO1irNSpYpWLidd9dnA+2rI85HZU+9B0Ktuwc1g=
=/D+o
-----END PGP SIGNATURE-----



More information about the varnish-dev mailing list