# iCalendar and vCard database structure and RoR

**URL:** <https://www.ruby-forum.com/t/icalendar-and-vcard-database-structure-and-ror/87072>\
**Category:** Rails\
**Created:** [February 27, 2007, 11:58pm UTC](https://www.ruby-forum.com/t/icalendar-and-vcard-database-structure-and-ror/87072 "2007-02-27T23:58:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7bcc69/32.png) [@Tony\_K](https://www.ruby-forum.com/u/Tony_K)\
**Post date:** [February 27, 2007, 11:58pm UTC](https://www.ruby-forum.com/t/icalendar-and-vcard-database-structure-and-ror/87072/1 "2007-02-27T23:58:50Z")

</div>

I am interested in using iCalendar and vCards with RoR. How are  
iCalendar and/or vCards stored in tables? Is the information in a  
vCard, for example, stored in a vCard table with one record per vCard  
vEvent or should the table structure be normalized with separate  
tables for name, address, telephone and etc? Or should the data  
structure be normalized using multiple tables? If they must be  
normalized tables, is there a recommended structure?

---

<div class="post-metadata">

**Author:** ![Tony\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7bcc69/32.png) [@Tony\_K](https://www.ruby-forum.com/u/Tony_K)\
**Post date:** [February 28, 2007, 8:47am UTC](https://www.ruby-forum.com/t/icalendar-and-vcard-database-structure-and-ror/87072/2 "2007-02-28T08:47:36Z")

</div>

There are several ways to do it as you have mentioned. Each option has  
its tradeoffs. You have to consider the application requirements and  
use your judgement to come up with a good solution. If the address,  
telephone etc are being used in other screens as part of some other  
model, then you can reuse those tables. Are you using the vpim library  
for the vCard?

---

<div class="post-metadata">

**Author:** ![Tony\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7bcc69/32.png) [@Tony\_K](https://www.ruby-forum.com/u/Tony_K)\
**Post date:** [February 28, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/icalendar-and-vcard-database-structure-and-ror/87072/3 "2007-02-28T15:08:30Z")

</div>

I want to use it as a method for users to import their information. I  
do want to be able to run queries on the data like time associated  
data like DTSTART and DTEND. I would tend to believe this would be  
too resource intensive if an entire iCalendar event was stored in one  
record. One would have to create objects for every iCalendar record  
before any data comparison could be made.
