?
Solved

creating an activity stream using mysql and html

Posted on 2013-01-20
9
Medium Priority
?
1,355 Views
Last Modified: 2013-01-25
Greetings,

I am trying to create an activity stream using mysql and html.
now, I assume that I would have a sql statement to pull the information from a database...

Now, I have four roles in this application. One of the roles monitors the activity of another, and the last two are independent.

That being said, I already understand that I would need a different SQL logic for each one, however the output dataset would be identical for each one.

How should I approach the relationship with the database?  I have a MVC framework (Laravel) that I'm using to employ PHP.

 Should I build the SQL in the business logic and send to the SQL to the database?  Or should I use a stored procedure at the database end?

I am going to make this stream ajax, so I can prepend the <UL> with more activities if more enters the database.  I also intend to only grab a days' worth of data, and do the "click for more" and append to the end of the <UL>.  Kinda like facebook.

THe reason for this is how I could maintain movement of data as the activity grows.

Thanks.
0
Comment
Question by:Evan Cutler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 26

Expert Comment

by:EddieShipman
ID: 38801168
It would be better if you don't assume that everyone knows what an activity stream is and better explain what it is you want. Your request is extremely vague for a general question asking about what technique to use.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38802236
Yeah if you give us specifics we might be able to understand what you are trying to do.  Showing us the code you are trying to get working would help.

Cd&
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 38802359
ok...let me back up here....
I need to create an activity stream.
I've been reading about creating activity streams, but having difficulties.

My original question was about creating the output dataset, because I have visit logs, but now I'm being asked about other activities as well.

so, to that effort my working theory was to query the logs to create the activity stream, however, I found myself with so many types of queries that the script would be 10,000 lines long.

I am now thinking of creating an activity table, with all activity, then query what I want, but I'm not still sure how to accomplish that.  I am looking at activitystrea.ms and some others for ideas.

Any wisdom on this would be awesome.
thanks for the time.
0
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
LVL 26

Expert Comment

by:EddieShipman
ID: 38802790
From wikipedia: "An activity stream is a list of recent activities performed by an individual, typically on a single website."

Is this what you are describing?
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 38802866
yes....it is...
similar to facebook.
I apologize for the quality of the questions.
I'm not sure I know the right questions to ask yet.

This is the first time I'm dealing with social networking activity.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38803041
The place you have to start is with database design. If activities center around individuals, then the id of the individuals needs to be the primary key of the table you drive from.  That table should only contain data about the individuals. Then build supporting tables for activites indexed on the individuals and either a sequence or timestamp.  The primary key can just be an auto increment value.

If there are interactions between activities then all you need is a cross table that associates the keys of the supporting tables.

That is pretty general, but the specifics are very dependent on the nature of the data.

Cd&
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 38803130
Thanks...I have logs in areas spanning the solution that I can use to create the activity.
My question is should I just push all activity to one table? and query the table? or do multiple queries from different tables and join them together?
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 2000 total points
ID: 38803139
0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 38819869
These got me started...thanks.
my next question is data model development for activity streaming.

Evan
0

Featured Post

Tutorial: Introduction to Managing a Linux Server

In this tutorial on systemd, we will explore:
-OS/Distro Adoption
-chkconfig and Other Legacy Commands
-Summary and Key Commands

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question