# To Norm, or not to Norm...?

**URL:** <https://forum.servoy.com/t/to-norm-or-not-to-norm/7893>\
**Category:** Classic Servoy\
**Created:** [July 26, 2007, 3:32pm UTC](https://forum.servoy.com/t/to-norm-or-not-to-norm/7893 "2007-07-26T15:32:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdotzlaw](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@gdotzlaw](https://forum.servoy.com/u/gdotzlaw)\
**Post date:** [July 26, 2007, 3:32pm UTC](https://forum.servoy.com/t/to-norm-or-not-to-norm/7893/1 "2007-07-26T15:32:29Z")

</div>

I have a number of value lists that I want to store in the SQL backend. These are distinct groups of values used in different areas of a large solution. The user will manage these values via the solution preferences.

For example:  
Contact types  
Project types  
Master tasks  
etc.

So, my question is, should I put each value list into its own table, or should I be combining them into one table called “valueLists” (how we did it in the old days with that “other” platform)?

Keep in mind performance is essential, as many tables in the solution will have 100,000’s of records, and there could be 100s of users on the system at one time.

I would appreciate an opinion on this.

---

<div class="post-metadata">

**Author:** ![gdotzlaw](https://avatars.discourse-cdn.com/v4/letter/g/5daacb/32.png) [@gdotzlaw](https://forum.servoy.com/u/gdotzlaw)\
**Post date:** [July 26, 2007, 4:01pm UTC](https://forum.servoy.com/t/to-norm-or-not-to-norm/7893/2 "2007-07-26T16:01:04Z")

</div>

I’ve decided to put everything in separate tables. Offers me more flexibility down the road.

---

<div class="post-metadata">

**Author:** ![Michael\_Mooney](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Michael\_Mooney](https://forum.servoy.com/u/Michael_Mooney)\
**Post date:** [July 26, 2007, 4:03pm UTC](https://forum.servoy.com/t/to-norm-or-not-to-norm/7893/3 "2007-07-26T16:03:36Z")

</div>

Gary,

I am in the midst of engineering for some SAAS things with high row counts as well … amidst learning the product and a number of experiments on this end ![:)]( "Smile")

Our engineering is using the following technique (not yet load validated but I am comfortable with this methodology with previous J2EE initiatives that had high volumes on the web in a Sun/Oracle cluster):

1. Parent table object to describe the valuelist or conceptually related item that needs persistence;

2. The child table uses a regular 4 byte INT (not BIGINT) for its PK. Other higher row count tables are using BIGINT’s as the PK. The child table acts essentially as a name-value pair (which form the “value list” items). The valuelist can then use either SQL providers (via routine Servoy relations and data providers) or issue a direct SQL call. Optionally, per an earlier thread or something in Servoy Mag I read (somewhere, sometime ![:)]( "Smile") ) one could issue a pre-load of the commonly used valuelists at solution/form load to avoid repeated calls to the db engine for each valuelist call. The INT from the child table is stored in the referencing table as a Foreign Key back to the child table.

Works fine for us in tests so far. No doubt there is more than one good solution to this!

Michael

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [July 26, 2007, 4:46pm UTC](https://forum.servoy.com/t/to-norm-or-not-to-norm/7893/4 "2007-07-26T16:46:48Z")

</div>

I’d go for 1 set of tables: valuelist, valuelistvalues & valuelistvaluetranslations (offcourse you can use differetn names ![:-)]( "Smile") ), with support for system and customer defined values, and active/inactive items.

A midsize to large solution will end up with quite a few valuelist. If you create a table for each one of those, you’ll have a lot of tables in your database, which in itself is not a problem, but it’s just not needed.

Paul

---

<div class="post-metadata">

**Author:** ![Michael\_Mooney](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Michael\_Mooney](https://forum.servoy.com/u/Michael_Mooney)\
**Post date:** [July 26, 2007, 8:02pm UTC](https://forum.servoy.com/t/to-norm-or-not-to-norm/7893/5 "2007-07-26T20:02:53Z")

</div>

Paul,

Sure … good tip and fair enough … thank you …

I pass along the valuelist name down to the child tbl as well (so the Filter in the Valuelist screen has something to work with). I ended up using a partially normalized model since there are other aspects needing control (at our site anyway) with a parent table.

Thx,

Michael

---

<div class="post-metadata">

**Author:** ![janteque](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@janteque](https://forum.servoy.com/u/janteque)\
**Post date:** [October 11, 2007, 8:35am UTC](https://forum.servoy.com/t/to-norm-or-not-to-norm/7893/6 "2007-10-11T08:35:22Z")

</div>

Paul, just one question.

I’ve been trying to define a normalized model like yours to store valuelists, but I’m not able to figure out how to make it multilingual.

In a model like yours, I guess that you have to load all valuelists on solution open by using a SQL query with current language as a filter, is that correct?

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [October 15, 2007, 7:18am UTC](https://forum.servoy.com/t/to-norm-or-not-to-norm/7893/7 "2007-10-15T07:18:01Z")

</div>

Yes, you are in control to load the valuelists
