Recording user activties in a SQL table - an unwieldy amount of data?











up vote
1
down vote

favorite












I've got an online application and I want to record key user events, such as when a user logged in, logged out, viewed certain record. For each of these interactions I can easily add a new row to a sql table with the user ID, event and timestamp, but won't I end up with an excessively large table pretty quickly?



EG - 100,000 users, 10 logs per session on average - that's a million rows already? Is this a problem? Am I worried about nothing?



I know that SQL databases can hold almost unlimited amounts of data, but the problem comes from when you then want to manipulate the data, and the time it takes. If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.










share|improve this question


























    up vote
    1
    down vote

    favorite












    I've got an online application and I want to record key user events, such as when a user logged in, logged out, viewed certain record. For each of these interactions I can easily add a new row to a sql table with the user ID, event and timestamp, but won't I end up with an excessively large table pretty quickly?



    EG - 100,000 users, 10 logs per session on average - that's a million rows already? Is this a problem? Am I worried about nothing?



    I know that SQL databases can hold almost unlimited amounts of data, but the problem comes from when you then want to manipulate the data, and the time it takes. If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I've got an online application and I want to record key user events, such as when a user logged in, logged out, viewed certain record. For each of these interactions I can easily add a new row to a sql table with the user ID, event and timestamp, but won't I end up with an excessively large table pretty quickly?



      EG - 100,000 users, 10 logs per session on average - that's a million rows already? Is this a problem? Am I worried about nothing?



      I know that SQL databases can hold almost unlimited amounts of data, but the problem comes from when you then want to manipulate the data, and the time it takes. If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.










      share|improve this question













      I've got an online application and I want to record key user events, such as when a user logged in, logged out, viewed certain record. For each of these interactions I can easily add a new row to a sql table with the user ID, event and timestamp, but won't I end up with an excessively large table pretty quickly?



      EG - 100,000 users, 10 logs per session on average - that's a million rows already? Is this a problem? Am I worried about nothing?



      I know that SQL databases can hold almost unlimited amounts of data, but the problem comes from when you then want to manipulate the data, and the time it takes. If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.







      php sql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 at 20:31









      PHPNewbie

      111




      111
























          4 Answers
          4






          active

          oldest

          votes

















          up vote
          1
          down vote













          Assuming you get 100.000 users per month, that's going to be what, a couple of megabytes of storage? My phone takes photos larger than that.



          Just do the simplest thing that works at first. If it's inserting records in a database, do that.






          share|improve this answer




























            up vote
            0
            down vote













            Find out for yourself - whats data you are realy need?




            • I think it some summary data


            So, every day run some cron script witch will be summarize needful data about an user to an another table with more less data length.
            After calculating an necessary data delete unuseful rows from an original table.






            share|improve this answer




























              up vote
              0
              down vote














              If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.




              Databases support indexes for exactly this type of operation. So, if you design your database properly, you will not see poor performance.






              share|improve this answer




























                up vote
                0
                down vote













                For really basic data stream collection, any SQL database will work, but you will eventually want to look at something more aligned to this type of data. For this type of time-series data, a streaming DB type might be more appropriate:




                • RethinkDB

                • Apache Kafka

                • Amazon Kinesis






                share|improve this answer





















                  Your Answer






                  StackExchange.ifUsing("editor", function () {
                  StackExchange.using("externalEditor", function () {
                  StackExchange.using("snippets", function () {
                  StackExchange.snippets.init();
                  });
                  });
                  }, "code-snippets");

                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "1"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420049%2frecording-user-activties-in-a-sql-table-an-unwieldy-amount-of-data%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  4 Answers
                  4






                  active

                  oldest

                  votes








                  4 Answers
                  4






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes








                  up vote
                  1
                  down vote













                  Assuming you get 100.000 users per month, that's going to be what, a couple of megabytes of storage? My phone takes photos larger than that.



                  Just do the simplest thing that works at first. If it's inserting records in a database, do that.






                  share|improve this answer

























                    up vote
                    1
                    down vote













                    Assuming you get 100.000 users per month, that's going to be what, a couple of megabytes of storage? My phone takes photos larger than that.



                    Just do the simplest thing that works at first. If it's inserting records in a database, do that.






                    share|improve this answer























                      up vote
                      1
                      down vote










                      up vote
                      1
                      down vote









                      Assuming you get 100.000 users per month, that's going to be what, a couple of megabytes of storage? My phone takes photos larger than that.



                      Just do the simplest thing that works at first. If it's inserting records in a database, do that.






                      share|improve this answer












                      Assuming you get 100.000 users per month, that's going to be what, a couple of megabytes of storage? My phone takes photos larger than that.



                      Just do the simplest thing that works at first. If it's inserting records in a database, do that.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 21 at 20:41









                      Joni

                      75.4k996148




                      75.4k996148
























                          up vote
                          0
                          down vote













                          Find out for yourself - whats data you are realy need?




                          • I think it some summary data


                          So, every day run some cron script witch will be summarize needful data about an user to an another table with more less data length.
                          After calculating an necessary data delete unuseful rows from an original table.






                          share|improve this answer

























                            up vote
                            0
                            down vote













                            Find out for yourself - whats data you are realy need?




                            • I think it some summary data


                            So, every day run some cron script witch will be summarize needful data about an user to an another table with more less data length.
                            After calculating an necessary data delete unuseful rows from an original table.






                            share|improve this answer























                              up vote
                              0
                              down vote










                              up vote
                              0
                              down vote









                              Find out for yourself - whats data you are realy need?




                              • I think it some summary data


                              So, every day run some cron script witch will be summarize needful data about an user to an another table with more less data length.
                              After calculating an necessary data delete unuseful rows from an original table.






                              share|improve this answer












                              Find out for yourself - whats data you are realy need?




                              • I think it some summary data


                              So, every day run some cron script witch will be summarize needful data about an user to an another table with more less data length.
                              After calculating an necessary data delete unuseful rows from an original table.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Nov 21 at 20:45









                              Николай Лубышев

                              40337




                              40337






















                                  up vote
                                  0
                                  down vote














                                  If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.




                                  Databases support indexes for exactly this type of operation. So, if you design your database properly, you will not see poor performance.






                                  share|improve this answer

























                                    up vote
                                    0
                                    down vote














                                    If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.




                                    Databases support indexes for exactly this type of operation. So, if you design your database properly, you will not see poor performance.






                                    share|improve this answer























                                      up vote
                                      0
                                      down vote










                                      up vote
                                      0
                                      down vote










                                      If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.




                                      Databases support indexes for exactly this type of operation. So, if you design your database properly, you will not see poor performance.






                                      share|improve this answer













                                      If I had a table of 400 million rows, and wanted to quickly extract those relevant to a specific user, I imagine I'd start seeing slow loadtimes.




                                      Databases support indexes for exactly this type of operation. So, if you design your database properly, you will not see poor performance.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Nov 21 at 22:43









                                      Gordon Linoff

                                      749k34285391




                                      749k34285391






















                                          up vote
                                          0
                                          down vote













                                          For really basic data stream collection, any SQL database will work, but you will eventually want to look at something more aligned to this type of data. For this type of time-series data, a streaming DB type might be more appropriate:




                                          • RethinkDB

                                          • Apache Kafka

                                          • Amazon Kinesis






                                          share|improve this answer

























                                            up vote
                                            0
                                            down vote













                                            For really basic data stream collection, any SQL database will work, but you will eventually want to look at something more aligned to this type of data. For this type of time-series data, a streaming DB type might be more appropriate:




                                            • RethinkDB

                                            • Apache Kafka

                                            • Amazon Kinesis






                                            share|improve this answer























                                              up vote
                                              0
                                              down vote










                                              up vote
                                              0
                                              down vote









                                              For really basic data stream collection, any SQL database will work, but you will eventually want to look at something more aligned to this type of data. For this type of time-series data, a streaming DB type might be more appropriate:




                                              • RethinkDB

                                              • Apache Kafka

                                              • Amazon Kinesis






                                              share|improve this answer












                                              For really basic data stream collection, any SQL database will work, but you will eventually want to look at something more aligned to this type of data. For this type of time-series data, a streaming DB type might be more appropriate:




                                              • RethinkDB

                                              • Apache Kafka

                                              • Amazon Kinesis







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Nov 21 at 23:45









                                              Dan Gayle

                                              1,4781631




                                              1,4781631






























                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Stack Overflow!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.





                                                  Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                  Please pay close attention to the following guidance:


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420049%2frecording-user-activties-in-a-sql-table-an-unwieldy-amount-of-data%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

                                                  Calculate evaluation metrics using cross_val_predict sklearn

                                                  Insert data from modal to MySQL (multiple modal on website)