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?

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

1 Comment

So this can load everything into my local cache irrespective of how large the database is?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.