Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3310088
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:43:04+00:00 2026-05-17T21:43:04+00:00

I’m upgrading a payment management system I created a while ago. It currently has

  • 0

I’m upgrading a payment management system I created a while ago. It currently has one table for each payment type it can accept. It is limited to only being able to pay for one thing, which this upgrade is to alleviate. I’ve been asking for suggestions as to how I should design it, and I have these basic ideas to work from:

  1. Have one table for each payment type, with a few common columns on each. (current design)
  2. Coordinate all payments with a central table that takes on the common columns (unifying payment IDs regardless of type), and identifies another table and row ID that has columns specialized to that payment type.
  3. Have one table for all payment types, and null the columns which are not used for any given type.
  4. Use the central table idea, but store specialized columns in a key/value table.

My goals for this are: not ridiculously slow, self-documenting as much as possible, and maximizing flexibility while maintaining the other goals.

I don’t like 1 very much because of the duplicate columns in each table. It reflects the payment type classes inheriting a base class that provides functionality for all payment types… ORM in reverse?

I’m leaning toward 2 the most, because it’s just as “type safe” and self-documenting as the current design. But, as with 1, to add a new payment type, I need to add a new table.

I don’t like 3 because of its “wasted space”, and it’s not immediately clear which columns are used for which payment types. Documentation can alleviate the pain of this somewhat, but my company’s internal tools do not have an effective method for storing/finding technical documentation.

The argument I was given for 4 was that it would alleviate needing to change the database when adding a new payment method, but it suffers even worse than 3 does from the lack of explicitness. Currently, changing the database isn’t a problem, but it could become a logistical nightmare if we decide to start letting customers keep their own database down the road.

So, of course I have my biases. Does anyone have any better ideas? Which design do you think fits best? What criteria should I base my decision on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:43:05+00:00Added an answer on May 17, 2026 at 9:43 pm

    Perhaps you should look this question

    The accepted answer from Bill Karwin goes into specific arguments against the key/value table usually know as Entity Attribute Value (EAV)

    .. Although many people seem to favor
    EAV, I don’t. It seems like the most
    flexible solution, and therefore the
    best. However, keep in mind the adage
    TANSTAAFL. Here are some of the
    disadvantages of EAV:

    • No way to make a column mandatory (equivalent of NOT NULL).
    • No way to use SQL data types to validate entries.
    • No way to ensure that attribute names are spelled consistently.
    • No way to put a foreign key on the values of any given attribute, e.g.
      for a lookup table.
    • Fetching results in a conventional tabular layout is complex and
      expensive, because to get attributes
      from multiple rows you need to do
      JOIN for each attribute.

    The degree of flexibility EAV gives
    you requires sacrifices in other
    areas, probably making your code as
    complex (or worse) than it would have
    been to solve the original problem in
    a more conventional way.

    And in most cases, it’s an unnecessary
    to have that degree of flexibility.
    In the OP’s question about product
    types, it’s much simpler to create a
    table per product type for
    product-specific attributes, so you
    have some consistent structure
    enforced at least for entries of the
    same product type.

    I’d use EAV only if every row must
    be permitted to potentially have a
    distinct set of attributes. When you
    have a finite set of product types,
    EAV is overkill. Class Table
    Inheritance would be my first choice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.