1

I recently developed my first module. Part of its functionality is to store names, e-mails, and phone numbers of people on a newsletter. They sign up through the front-end and the admin can review and modify them on the backend.

In addition it also stores SMS messages and their details (date sent, number sent from, message, etc) that come in from a short code. This process is triggered by an HTTP request. Again, the admin can review and modify these in the admin of the website.

And finally, the same install will host 15-20 tables with ~20 columns and ~170 rows of health, education, and water quality statistics that can be queried from the website.

So that's everything: newsletter list, sms messages, data

I've never worked with a CMS and added so much to the default database. I also lack a lot of knowledge about databases. So my question is Should I store all this extra information in a different database? My current hosting allows for 20, and I'm only utilizing one.

Let me know if you need any extra information. Thanks in advance!

  • 2
    Quoting a very clever guy: Performance is determined by queries and indexes (at the most basic level): not number of objects. If it was me I'd keep them all in the same database and not worry about the number of tables, unless you notice a serious performance decrease – Clive Aug 22 '12 at 18:00
2

I'm afraid you need a long answer for this.. But using a data*base* to store different values like this is not the best way I guess.

You can use multiple databases with Drupal and switch them without a problem. But real question would be, why.

However, you can store categories in different table,and refer the category ID from the main sms message table. It's much easier to JOIN queries and get the data you want,rather than having a table for each category. Also, I'd suggest using core functionality when you can. With new entity system in Drupal 7,you can make a new entity, an SMS, and attach fields like category it to.

If you are storing settings of the module, consider using system_settings_form to store settings. You can set/get them using variable_set and variable_get. But make sure that you don't store big text using this.

Good luck!

  • ayesh Thank you for directing me towards the entity system. I've been browsing around that and it looks very powerful. clive Thanks for the quote, that provides a great larger statement for my question. My reputation doesn't allow me to give either of you credit :( – Lucas Healy Aug 23 '12 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.