Is it possible via custom javascript middleware to connect to a local database? (like mongoDB)

Hello there :slight_smile:
My organization is trying to find solutions for old authentication system in our current system, and we consider Tyk as our main gateway solution. We need to know how we can interact with a sidecar database in our pod. Basically, we need to understand how we can map data from old to new.
So, my main question is, what is the right way to create a middleware in each request and check our data against a local database in the same pod/node? and how can and where I can install the right Sdk’s?

@alexander.alkhazov Hello and welcome to the community :tada:

I don’t think this is something you have enough flexibility with considering our JavaScript middleware runs in a Sandboxed JSVM powered by [Otto engine] (GitHub - robertkrimen/otto: A JavaScript interpreter in Go (golang)).

You are probably better of using something like a NodeJS gRPC plugin. A comparison of our plugin offers may be of assistance to you.

Additionally, we do have a couple of examples in Golang in our plugin examples that shows how you can connect to an external DB like Redis and DynamoDB.

Hope this helps