Topic: Python Question

Offline Arseynimz

  • Administrator
  • Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!
  • Posts: 2,600
Devs at work looking to change python scripts, so they are in the database... Question is, why would they not be in the dbase, and what is the advantage of moving them to the dbase?

Thanks dudes!

Posted: July 08, 2014, 02:03:48 pm
Maybe if i just click this.....shit...DV gonna be maaaaad!

Offline Xsannz

  • Addicted
  • Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!Xsannz is awe-inspiring!
  • Posts: 5,412
so they are looking at storing the script in the DB?


you could store them in a db but characters limits and special characters often stuff up databases, if these are simply just scripts then it would make sense to have to update a db every time you make a script change, depends on if it's an app thats using them then you could store them in a db and the app is your interface via user options for editing and cooling the scripts..

or are these Stored Procedures written in python?

needs more scope around what where and how without the company detail



Reply #1 Posted: July 08, 2014, 03:11:11 pm

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
Sorry Arsey, but the actual question here is why WOULD you store them in a database?
Scripts do not belong there. That's why they're not.

And at any point you're still going to need some bootstrap code to fetch the rest of the script from the DB.

But yeah, if the script itself stays outside but core pieces of database logic gets stored in the database as a 'stored proceedure' (or whatever other terminology is floating around these days) then yeah, that makes perfect sense.

The database should look after data (storing, fetching, manipulations, etc).
The scripts should be in the filesystem and looking after controlling that data.

Reply #2 Posted: July 12, 2014, 10:53:31 pm
Everyone needs more Bruce Campbell.

Offline Arseynimz

  • Administrator
  • Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!
  • Posts: 2,600
Yeah, when I asked the developers, they said they were trying to take some of the load off the application server, and apparently the scripts are reports... I am still perplexed as to why they're doing it, and have asked for a specification on the reason. Thanks for the info guys, combined with the above and a bit of reading and googling, I'm happy I'm asking the right questions.

Reply #3 Posted: July 13, 2014, 10:56:30 am
Maybe if i just click this.....shit...DV gonna be maaaaad!

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
If they're writing stored proceedures to produce views in server, then that's fine. And that's bascially all a report is.
I imagine there'll still be a wee python frontend to collect input (if any - such as filters) and initiate the db request.

Of course if stress is the issue, and you're alleviating pressure on script server by putting it on the db server... make sure the db server can handle it first (lest you're merely transferring a problem).

Reply #4 Posted: July 13, 2014, 10:14:51 pm
Everyone needs more Bruce Campbell.

Offline Arseynimz

  • Administrator
  • Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!Arseynimz is awe-inspiring!
  • Posts: 2,600
Of course if stress is the issue, and you're alleviating pressure on script server by putting it on the db server... make sure the db server can handle it first (lest you're merely transferring a problem).
And this seems to be exactly what the problem is... transferral of a problem from one space to another. And potentially putting it to the dbase server will cause more issues!

Reply #5 Posted: July 14, 2014, 01:32:04 am
Maybe if i just click this.....shit...DV gonna be maaaaad!

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
Of course that depends on spec, and all that. And how the db server (or cluster) is set up (load balancing, etc).
It may not be transferrance, but it does need to be considered.

Also the type of database it is is important. I'm assuming MSSQL or Oracle.
If it's MySQL then the answer is just pretty much no. Never. Not even once. PgSQL or go paid.

Reply #6 Posted: July 14, 2014, 02:23:27 am
Everyone needs more Bruce Campbell.