<p>It's difficult to answer this without specifics on what you're looking for and what your plugin is trying to do, but I'd recommend following the <a href="https://craftcms.com/docs/plugins/introduction" rel="nofollow">plugin development docs</a>, which includes <a href="https://craftcms.com/docs/plugins/database" rel="nofollow">working</a> with <a href="https://craftcms.com/docs/plugins/migrations" rel="nofollow">databases</a>.</p>

<p>I'd also recommend using somethign like <a href="https://pluginfactory.io" rel="nofollow">https://pluginfactory.io</a> to generate the plugin boilerplate code for the plugin components you might need.</p>

CC BY-SA 3.0
2016-10-28T17:39:43.867Z
2016-10-28T17:39:43.867Z
Brad Bell
<p>Hope this question isn't too vague.</p>

<p>I was wondering if there was any documentation or guidance on the database(s) underpinning Craft?</p>

<p>I am going to be working on a website with a fair amount of data and, crucially, the need to pull quite a lot of pieces of data frequently.</p>

<p>You can see a version of it here: <a href="http://unlockinglovelocks.co.uk" rel="nofollow">http://unlockinglovelocks.co.uk</a></p>

<p>At the moment, using the dropdowns, you can navigate to a large picture which is mapped, so that clicking on each padlock will bring up its details. Eventually, my friend who requested the site expects to catalog a large number of these (potentially several large images, each featuring dozens of locks, related to just one site --- multiple sites per area --- multiple areas)</p>

<p>Am looking for a setup that won't end up being slow or inefficient. Basically want to understand a bit more about how the data storage with Craft works, so I can try and do it right :p</p>

<p>Any recommended resources would be welcome - I have had a google, and a browse of the Craft docs, without much luck.</p>

CC BY-SA 3.0
2016-10-26T17:45:53.003Z
Sorry, but I'm not 100% sure of what you're looking for.  Are you looking on advice on how you might architect the database tables in a plugin for that particular site?
Brad Bell
CC BY-SA 3.0
2016-10-28T15:41:46.963Z
I guess I'm not sure - I read somewhere that Craft just sticks everything in one big table? In which case, should I create a plugin or something to allow me to separate them out into different tables?
Starfall Projects
CC BY-SA 3.0
2016-10-28T18:49:03.530Z
Hi Feathers, this question is far to broad for the Stack Exchange format. I recommend joining the [Craft Slack channel](https://craftcms.com/community#slack) instead... there are tons of friendly people who can help you get a better understanding of Craft's inner workings!
Lindsey D
<database>
Database documentation / tips / resources
# Database documentation / tips / resources

(Asked by: username_0 on 2016-10-26)

Hope this question isn't too vague.

I was wondering if there was any documentation or guidance on the database(s) underpinning Craft?

I am going to be working on a website with a fair amount of data and, crucially, the need to pull quite a lot of pieces of data frequently.

You can see a version of it here: <http://unlockinglovelocks.co.uk>

At the moment, using the dropdowns, you can navigate to a large picture which is mapped, so that clicking on each padlock will bring up its details. Eventually, my friend who requested the site expects to catalog a large number of these (potentially several large images, each featuring dozens of locks, related to just one site --- multiple sites per area --- multiple areas)

Am looking for a setup that won't end up being slow or inefficient. Basically want to understand a bit more about how the data storage with Craft works, so I can try and do it right :p

Any recommended resources would be welcome - I have had a google, and a browse of the Craft docs, without much luck.

**Tags:** database

> **Comments:**
> **username_1**: Sorry, but I'm not 100% sure of what you're looking for.  Are you looking on advice on how you might architect the database tables in a plugin for that particular site?  
> **username_0**: I guess I'm not sure - I read somewhere that Craft just sticks everything in one big table? In which case, should I create a plugin or something to allow me to separate them out into different tables?  
> **username_2**: Hi Feathers, this question is far to broad for the Stack Exchange format. I recommend joining the [Craft Slack channel](https://craftcms.com/community#slack) instead... there are tons of friendly people who can help you get a better understanding of Craft's inner workings!  

---

## 1 answers

### Answer by username_1 on 2016-10-28. Score: 3

It's difficult to answer this without specifics on what you're looking for and what your plugin is trying to do, but I'd recommend following the [plugin development docs](https://craftcms.com/docs/plugins/introduction), which includes [working](https://craftcms.com/docs/plugins/database) with [databases](https://craftcms.com/docs/plugins/migrations).

I'd also recommend using somethign like <https://pluginfactory.io> to generate the plugin boilerplate code for the plugin components you might need.


---

