Database design for objects with multiple states

Context
I'm designing a database which, simplified, should be able to handle users sending job requests to each other, and after that a job can be started, finished, and reviewed. The design should be scalable (think millions of users).
Approaches I've considered:
Gargantuan table
One approach, probably not the best one, would be to simply store ALL jobs in one, huge table
jobs. This table would need a state column to represent which state the job is currently in (e.g.
ACCEPTED, STARTED, FINISHED, REVIEWED e.t.c.). The biggest problem with this approach that I can see is that jobs in different states have different types of data that are relevant to them. For example, a
job request has a preliminary agreed upon price, but that could change before the job is started, and change again before the job is finished. This could of course be solved by just adding more columns to the table and naming them properly, but it will probably
become a huge bottleneck performance-wise very early to have one table containing all the different types of possible data for all the different possible states of a job.
Different tables for different states
This approach would be to have multiple tables, for example job_requests,
jobs_started, jobs_finished, tables who in turn can have substates, e.g.
job_requests could have the sub-states PENDING, ACCEPTED, while the
jobs_finished table would have the substates COMPLETED,
CANCELLED, REVIEWED.
With this approach each table only contains data which is relevant to the current job state, but on the other hand some data might be duplicated (for example the user ids of the job requester, and job receiver -- on the other hand this information could
be stored in yet another table?). The problem with this approach is that I can't think of a good solution on how to archive all the information when transitioning between states. For example, once a job request has been accepted, and then started, it should
be deleted from the job_requests table and moved into the jobs_started table, but it's just a matter of time before a stakeholder wants to know for example how long the average time is between a job request being created, until it's
been started, at which point I'd need the data from the job_requests table to be able to calculate it.
It feels like this type of problem should be easy to solve, but I really can't think of any good solution which "feels right", any solution I come up with feels ugly and I can immediately think of a number of things which makes the solution bad.
Very grateful for any feedback or tips on approaches I could take. Thanks in advance!

This will be moved to the design fourm, which I don't monitor, by a moderator within a day or so.
A table in a relational database is supposed to model a unique entity. Job is such an entity. But "Jobs in Washingon state" and "Jobs in Oregon" are two such unique entities.
I don't see why jobs in different states would have different attributes, but it is not my business domain. And the problem certainly appears in other areas. My area is financial instruments, and they come in many flavours. And still have many attributes
in common.
So what we do is that we have a table instruments which holds common data. And then there are tables like funds, futures, bonds, optionandwarrants etc that holds attributes that unique to these classes of instruments. These specific tables are child tables
to the instruments tables.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Object with multiple states and slider in folio are rasterized, settings seem correct.

    I am having trouble keeping An object with multiple text states from being rasterized, as well as a slider that is also rastering.
    I have read that you are supposed to set the folio and article up to be .pdf and that the slider should have the vector option chosen.
    I haven't found anything for the multi state object to for these settings.
    What happens is when I output the folio to Adobe Content Viewer, only the text in those items is rasterized. All other text is crisp. Tested on both iPad Mini and iPad Retina and the both are blurry.
    Is there a way to force the vector option? It seems even with the correct options selected it is still rastering the test in interactive elements.
    Thanks!

    Here is the MSO with the folio.
    Here is the Slider with folio overlays panel.

  • Database Design for use with XSQL-connected Clients

    Hi all,
    this might seem a little off-topic at first, but I suppose we are not the only ones reading this group designing an architechture using XSQL servlet as the only connection to the database, with clients connecting over the internet.
    So far our approach works well, but of course any database round trip is much more expensive in this environment than with clients that hold an open connection to the database.
    That led us to the idea of generating primary keys on the client instead of the database (e.g. with CoCreateGuid on Win32). Do those GUIDs have to be stored in the Oracle database in a RAW column or does a NUMBER field do the job?
    I found a hint in the Oracle 8i Replication manual to use SYS_GUID values in a RAW(32) column as a primary key to avoid conflicts between sequences on multiple machines. But I didn't find any statement concerning the performance issues of this.
    Our database will not store huge amounts of data (most tables < 100.000 rows, just a handful more than a million in huge environments, which will be able to afford huge machines...), so this should not be
    a problem, I guess.
    Does anyone of you have experience with this?
    And another question: Can I safely assume that keys generated with SYS_GUID on the Oracle server will not likely be the same as those that are generated using CoCreateGuid on the Win32 client?
    Thanks for your input.
    Olaf Lewitz
    ohltec SOFTWERFT, Hamburg

    Don't GUID's have hyphens in them? If so, you'd have to use a VARCHAR2(xx) of appropriate length. If not, then you can likely use HEX_TO_RAW() and RAW_TO_HEX() to store then in a RAW as you've noted.
    Note that the XSQL Servlet's default connection manager does to connection pooling, so the roundtrip to the database may not be as expensive as you're thinking. :-)

  • How to design a form with multiple lang(Arabic and Eng) in a page

    Hi All,
    Could you pls help me how to design a form with multiple languages. when I set the form proprties-->Form Locale as Arabic. English text is comming in reverse and when set the FormLocale as English, Arabic text is comming in revese.
    Pls help me how to design
    Thanks in advance.
    Regards,
    Jayakar

    I am not sure how you can have two different languages inside the same PDF.
    Alternatively, if you want to place only the static labels, you can convert all the static label in one language to images and set the form language setting to other. And place the images inside the form using Image field. For example, you can keep the form language as English and then convert all the arabic language labels/ Static text to images.
    Anotherway,
         Have same sections in both the languages and hide and unhide based on the user selection of the language..
         if your user chooses Arabic, then you can unhide the Arabic sections and change the form language properties programmatically..
    Thanks
    Srini

  • How to design a form with multiple lang(Arabic and Eng) in a pge

    Hi All,
    Could you pls help me how to design a form with multiple languages. when I set the form proprties-->Form Locale as Arabic. English text is comming in reverse and when set the FormLocale as English, Arabic text is comming in revese.
    Pls help me how to design
    Thanks in advance.
    Regards,
    Jayakar

    I am not sure how you can have two different languages inside the same PDF.
    Alternatively, if you want to place only the static labels, you can convert all the static label in one language to images and set the form language setting to other. And place the images inside the form using Image field. For example, you can keep the form language as English and then convert all the arabic language labels/ Static text to images.
    Anotherway,
         Have same sections in both the languages and hide and unhide based on the user selection of the language..
         if your user chooses Arabic, then you can unhide the Arabic sections and change the form language properties programmatically..
    Thanks
    Srini

  • Database design for share market

    Hi One and All,
    I have a query regarding, design of New database....
    Right now I joined as a Database administrator as a fresher, my superior has given me one assignment i.e. I have to create a sample database on Share market. As per his requirement the tables should be Issuer table, Security table, Broker table, INvestor table, Account table, Order table, Tradeing table. He said that I have to prepare the fiellds for this tables and relation ships and whole database structure.... I can prepare relations ships and database structure but the problem is, I don't know how the stock market is really works. If any body help me in this issue I am very thank full to him.
    I need just the table feilds, if I get this rest of job i wil do by studying the subject of share market.
    Thank You

    Hi,
    As per Hemant this forum is not appropriate for this question. However you have to analyze the system by meetings with stock broker at stock Exchange or to the client for which you are designing the system. Ask your superior to arrange meeting with client and then ask question to him so that you can made database design for them.
    Regards,
    Abbasi

  • Database design for Help Desk application.

    Hello does any one know
    Database design for Help Desk application.
    ERD
    Business rules and features
    ?

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • DataBase Design For InvoiceSystems

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Invoice Systems
    Please Could you help me in terms of DataBase Design......

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • DataBase Design For Inventory Systems

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Inventory Systems
    Please Could you help me in terms of DataBase Design......

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • How to Restrict Single Delivery Date for PO with Multiple Line Items

    Dear Experts,
    How to Restrict Single Delivery Date for PO with Multiple Line Items.
    System needs to through Error Message if User Inputs Different Delivery Dates for PO with Multiple Line Items in ME21N Tcode.
    Can we achive this by Some Enhancement in SAP or Not ???
    If so how to do it.
    Any Inputs is highly appreciated.
    Thanks and Regards,
    Selvakumar. M

    Hi Selvakumar,
    we can resrict the PO to have a single delivery date in all the line items by means of giving a error message or overwiting the delivery date keyed/determined in the line item.
    You can use the BADI -> ME_PROCESS_PO_CUST. In which you need to implement the method PROCESS_SCHEDULE.
    (for technical aid - This method will be called for each and every PO line item, From the imporing parameter im_schedule we can get all the details of current PO line, even we can change the data in the current PO line. )
    Regards,
    Madhu.

  • Partial goods receipt for PO with multiple line items

    Hello All,
    While doing MIGO, for a PO with multiple line items, if one line item is having error, will we be able to go ahead with goods receipt? Or entire material document is blocked for doing MIGO?
    We will be doing a development - in case if there is problem in goods receipt (checking of any parameter, and if it is missing - we will be posting error message)...is it possible to ahead with next line item and still post the material document?
    If partial goods receipt if possible for PO with multiple line items, how do we do it?
    Regards,
    RJS

    Hi
    While doing MIGO, for a PO with multiple line items, if one line item is having error, will we be able to go ahead with goods receipt? Or entire material document is blocked for doing MIGO?
    No. You cannot post the MIGO, if even one of the PO line item is having problem or giving error.
    We will be doing a development - in case if there is problem in goods receipt (checking of any parameter, and if it is missing - we will be posting error message)...is it possible to ahead with next line item and still post the material document?
    If you skip a line irem and do GR with next line item, how will you match quantity & value with the vendor Invoice at LIV ?
    If partial goods receipt if possible for PO with multiple line items, how do we do it?
    Partial goods receipt is possible for PO line items. That means, if PO has 100 qty for line item 1 then you can do GR for 50 now and 50 later depending on the vendors delivery.
    Hope this is what you mean by "Partial Goods Receipt".
    Edited by: Arun R on May 10, 2010 2:03 PM

  • DataBase Design For Library maintenance

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Library Maintenance
    Please Could you help me in terms of DataBase Design......

    Suyambu
    You have asked several questions of this nature.
    A forum cannot be expected to take the place of a comprehensive book or training course.
    Please ask reasonable questions about distinct issues which can be given succinct replies.

  • DataBase Design For Library maintanence

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Library Maintanence
    Please Could you help me in terms of DataBase Design......

    Suyambu
    You have asked several questions of this nature.
    A forum cannot be expected to take the place of a comprehensive book or training course.
    Please ask reasonable questions about distinct issues which can be given succinct replies.

  • Class not registered. Looking for object with CLSID:

    Hi,
    I had create a custom project system with the help of https://msdn.microsoft.com/en-us/library/vstudio/cc512961.aspx. And which is working fine that I can create a project with extension of .myproj in the VS Experimental Instance window. But when I go for
    the properties in the created project, (Solution Explorer: Right click on the project folder and select properties) it will show an exception that "Class not registered. Looking for object with CLSID:{00000-00-00-000000}" How can I provide Properties
    window for this project system or can I modify the Properties window for any other default VS project system? Please help me.

    Hi mathikp,
    I don't think you did something wrong while creating the project, but instead it could be the issue of environment, I would suggest you to validate following things:
    1, Try to create another blank app to see if the exception still thrown.
    2, Run with an administrator privilege to check if you can get the project work..
    I would not consider its as a coding issue but try to fix Visual Studio probably helps.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Implementing a view Object with Multiple Updateable Dependent Entity Objects

    Hello,
         I want to implement view object with multiple updateable entity object,
         i have refered this link its good https://forums.oracle.com/thread/63721
         here they have explained with 2 table,
         but when we have more then 5 tables and each table have Primary keys , Foreign key , Sequence and  trigger created on it. Then whats steps should i want to fallow.
         if possible some please provide the link or some one help me out how to do this .
         thanks in advance
         cheers

    Has the Advanced View Object Techniques been referred?

Maybe you are looking for

  • Data in sapscript

    i wrote : &vbap-xblnr& what i need to do to get this value without going out to se38 ang select the value.

  • How can I search events inside my calendar with Lightening enabled?

    I have Lightening enabled in Thunderbird. I have all my calendars working. I just can't see any way to search events. All my toolbars are selected. I see no search function. Is there one? Can someone offer assistance? Thanks!

  • Support Links Don't Work

    I have noise and static on my home phone line and my DSL internet connection keeps failing.  I tried to use the Support option at this address:  https://www.verizon.com/ForYourHome/VZRepair/vziha/Service.aspx?ihaweb=WebNoiseOnLine but it does not wor

  • [Solved] Problems with net-auto-wired, no interent after install

    *Background* I am returning to Arch Linux after being away for about a year. I have finally had a chance to install Arch on my new laptop. Since I am new to systemd and the new installation process I followed the beginners guide very closely. *Descri

  • Lightroom metadata and Bridge compatibility

    Dear members: I have some questions I would like to have answered prior to deciding whether I should invest on Ligthroom and thought I would post them here to get some input. They are: 1. Is metadata assigned to a DNG file by Lightroom interchangeabl