Sunday, 15 January 2012

c++ - Django as a mysql proxy server? -



c++ - Django as a mysql proxy server? -

i'm in process of building django powered site backed mysql server. mysql server going accessed additional sources, other website, read , write table data; such programme users run locally connects database.

currently programme running locally using mysql/c connector library connect straight sql server , execute queries. in final release public seems insecure, since exposing connection string database in code or in configuration file.

one alternative i'm considering having queries sent django website (authenticated user's login , password) , site sanitize , execute queries on user's behalf , homecoming results them.

this has number of downsides can think of. webserver under much larger load processing sql queries , potentially exceed limit of host. additionally, have figure out way of serializing , transmitting sql results in python , unserializing them in c/c++ on client side. decent amount of custom code write , maintain.

any other downsides approach people can think of?

does sound reasonable , if does, ease working on it; such python or c libraries help develop proxy interface?

if sounds bad idea, suggestions alternative solutions i.e. python library specializes in type of proxy sql server logic, method of encrypting sql connection strings can securely utilize current solution, etc...?

lastly, valid concern? database doesn't hold terribly sensitive info users (most sensitive email , site password may have reused source) in future cause concern if it's not secure.

this valid concern , mutual problem. have described creating restful api. guess considered proxy database not referred proxy.

django great tool utilize use accomplish this. django has couple packages assist in speedy development, django rest framework, tastiepy, , django-piston popular. of course of study utilize plain old django.

your django project thing interfaces database , clients can send authenticated requests django; clients never connect straight database. give fine grained permission command on per client, per resource basis.

the webserver under much larger load processing sql queries , potentially exceed limit of host

i believe scaling webservice going lot easier scaling direct connections clients database. there many tried , true methods scaling apps have hundreds of requests per seconds databases. because have django between , webserver can implement caching requested resources.

additionally, have figure out way of serializing , transmitting sql results in python , unserializing them in c/c++ on client side

this should moot issue. there lots of extremely popular info interchange formats. have never used c/c++ quick search saw couple of c/c++ json serializers. python has json built in free, there shouldn't custom code maintain regarding if utilize premade c/c++ json library.

any other downsides approach people can think of?

i don't think there downsides, tried , true method. has been proven decade , popular sites in world expose through restful apis

does sound reasonable , if does, ease working on it; such python or c libraries help develop proxy interface?

it sounds reasonable, django apps mentioned @ origin of reply should provide boiler plate allow started on api quicker.

c++ python mysql c django

No comments:

Post a Comment