0

I want to load a database from a remote server to my memory/cache, so that I don't have to make network calls every time I want to use the database.

I am doing this in Python and the database is cassandra. How should I do it? I have heard about memcached and beaker. Which library is best for this purpose?

linusg
  • 6,289
  • 4
  • 28
  • 78
Yashwanth Remidi
  • 161
  • 1
  • 4
  • 13

1 Answers1

1

If you are trying to get some data from a database, use the pyodbc module. This module can be used to download data from a given table in a database. Answers can also be found in here.

An example how to connect:

import pyodbc
cnxn = pyodbc.connect('DRIVER={SQLServer};SERVER=SQLSRV01;
                       DATABASE=DATABASE;UID=USER;PWD=PASSWORD')
cursor = cnxn.cursor()

cursor.execute("SQL_QUERY")
for row in cursor.fetchall():
    print row
Community
  • 1
  • 1
Premysl Vorac
  • 473
  • 6
  • 16