I need to store stock market data and stock graph datas for my site . so i am selecting two db's mongo and cassandra and i finalize cassandra db, i am using windows 7 , Xampp and i need to use this in yii. i am installing data stack it is working in cli and its also working in (localhost:8888) . so now how can i connect it in yii site .

Is this requirement solvable . i need the steps to connect. because diffrent site tells the different solution .

Recommended Answers

All 9 Replies

i am using extension from the follwing link github.com/masumsoft/yii-cassandra-cql3 . but i am having the following error "cassandra\InvalidRequestException"
D:\xampp\htdocs\finance_casen\protected\extensions\yii-cassandra-cql3\Thrift\Base\TBase.php(206)

when i am using the follwing code in my controller :

$query_result1 = Yii::app()->cassandra->cql3_query("CREATE TABLE users (user_name varchar,password varchar,gender varchar,session_token varchar,state varchar)");
    $query_result2 = Yii::app()->cassandra->cql3_query("INSERT INTO users(user_name, password) VALUES ('saran', 'raja')");
    $query_result = Yii::app()->cassandra->cql3_query("SELECT * FROM users");
    $rows = Yii::app()->cassandra->cql_get_rows($query_result);
    print_r($rows);

Hi cereal,
Now i am able to insert and fetch the datas using cassandra extension. The issue is first time i run the code the table was created.then next time the same create table query executed first thats the problem.

If you still have problems it may be related to this query:

$query_result1 = Yii::app()->cassandra->cql3_query("CREATE TABLE users (user_name varchar,password varchar,gender varchar,session_token varchar,state varchar)");

This will try to create the table each time you run the code, if this is required by your application, change the query so it runs only if the table does not exists, so:

$query_result1 = Yii::app()->cassandra->cql3_query("CREATE TABLE IF NOT EXISTS users (user_name varchar,password varchar,gender varchar,session_token varchar,state varchar)");

Documentation: http://dev.mysql.com/doc/refman/5.5/en/create-table.html

i need a guidance from u.Now i want to store the fetched data from yahoo api for stock details , graph datas and news feed . it ill become a large amount of data . how can i maitain this , means i need put cron job for this and run it for every minute and store all the stock datas for all companies and graph data for all companies . is it right ? . and can i use the above query to insert and fetch . or any addtional feture used in cassandra i don't know. in my site i need to show the stock details and graph for the user input . inupt may be date from and to or ticker symbol and dividend yeild ect . i am new to yii casandra and yahoo finance api and share market.we can't get the datas only from live . we need afull back up also . if cassandra fails we cant get the data back .i am using the test cluster single node for cassandra . i need a guidence to do the site successfully . please advise me .

I'm sorry, I'm afraid I cannot answer that, you're asking how to develop your project, that requires a good knowledge of your application requirements and about the technologies to use. I can only suggest you to try to break everything in many little problems, that way you can focus better on the single aspects of the application.

Note - in my last reply I posted a wrong link, the correct one was this: http://cassandra.apache.org/doc/cql3/CQL.html#createTableStmt

hi cereal,

ok no problem , i am using the following url to get yahoo finance chart data and able to generate graph

http://chartapi.finance.yahoo.com/instrument/1.0/GOOG/chartdata;type=quote;range=1d/csv/

http://chartapi.finance.yahoo.com/instrument/1.0/GOOG/chartdata;type=quote;range=5d/csv/

http://chartapi.finance.yahoo.com/instrument/1.0/GOOG/chartdata;type=quote;range=1Y/csv/

but i dont want to get from api , i need a back up so i want store it in db where can i get the full graph data and regularly update the db.is it available or need to run cron job and store the data

The problem is that the Yahoo API Terms of Use does not allow to store data for more then 24 hours, so, you can just cache for a day and then you have to request the data:

This means that you can still write data to Cassandra or to a memory cache as Memcached or Redis and use a cronjob to remove it after 24 hours. So: no collection, just cache.

If you're still in doubt regarding the permission to save data, then you may want to ask to the Yahoo Developer Forum:

Probably in the YQL forum or the General forum.

Regarding the script to save data from the links you posted above, you can refer to the example that I wrote to you in a previous thread:

If you've still problems then show your code.

Hi cereal,
i need to get the economic indicators for stock market,If the yahoo api provides it ? or where else i get it .and another doupt is heat maps data for the stock market . what is it please explain it in detail.

Thank you very much for your replies.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.