Support » Requests and Feedback » EVERYTHING gets a post ID. Isn’t there a better way?

  • Stephen

    (@stephenhampton)


    Absolutely every change in WordPress, whether it’s a blog post or a WooCommerce order, all get issued a post ID. Wouldn’t it be better to split this up and let different features/functions get their own numbering (perhaps their own databases even).

    I look after a busy shopping site and I feel like the database is under a lot of strain. It would be better if one database dealt with sales, and another was for WP and tracked visitor stats etc. Then another database for a discussion forum.

    Surely multiple small dedicated databases would be better than one huge monster?

    I understand that WP started out as just a blogging site and has grown into this multipurpose Frankenstein of a platform and changing it now would cause enormous grief for many plugin developers, but just an option to allocate a separate database to certain plugins would be great, IMO. (Especially WooCommerce)

Viewing 8 replies - 1 through 8 (of 8 total)
  • Wouldn’t it be better to split this up and let different features/functions get their own numbering (perhaps their own databases even).

    No.
    It would be a terrible idea. How would data be normalized to accommodate the constant changes? Not to mention opening and closing a database call for everything single request, managing all the connection strings, etc, etc, etc.

    Surely multiple small dedicated databases would be better than one huge monster?

    No. The indexes take care of this.

    Moderator Steve Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Rep

    Note that some plugins create their own tables in the database. I think you’re confusing DATABASE with TABLES within a database. There are times when separate tables might be better than overloading (in the functional sense) tables to support disparate data.

    If you find MySQL/Maria straining, it may be that you need to look into the tuning of your database engine, though your host may not allow you access to that level of control.

    Note that the post ID field is a 32bit unsigned integer so, if I recall correctly, it can handle 19 billion values.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Post ID is an unsigned bigint, meaning it is a 64-bit value. That’s 18,446,744,073,709,551,616 as the maximum value. So, 18 billion-billion.

    However, First and foremost, WordPress is a CMS which started out as a blog. So yes, everything kinda falls into the “stuff is a post” category. However, where WordPress is now hasn’t really changed much from those beginnings.

    It’s a publishing tool, not a store front. It doesn’t come with a shopping cart. Sure, you can use plugins and various things to add those types of things, but how they store data is entirely up to them. Should they put everything in the posts table? Who can say?

    By and large, WordPress is about making webpages out of content from the database, mixed with the theme, and having enough versatility to let plugins hook into there and do whatever it is they do. From that viewpoint, yes, everything *WordPress* does is a post. It’s all about getting content fast and displaying it fast. So, if you want to build a storefront and store data in fully relational databases, then go ahead and do that. WordPress will be there to display the results from your plugin just fine. You can store your data how you prefer.

    Whether or not you call it a POST ID or any other kind of ID, the fact will remain that a db needs primary keys, foreign keys, etc, etc. (and I’m not asking for a a NoSQL lesson here btw, lol)

    I’m not sure why you would care the way the db structures the data, or why you would care how the WP functions and files access that data. All things considered, it works pretty well and is generally fast to access data and display data.

    That said, use the right tool for the job, and one you are happy with.
    Loads of people use a WordPress + WooCommerce plugin for their online shop which I personally never recommend. I dunno why it’s a thing. WooCommerce has a great marketing department I guess.

    • This reply was modified 3 months, 1 week ago by corrinarusso.
    Rohjay

    (@redearryan)

    I realize I’m not about to answer your question exactly as you ask it, but perhaps what I’m about to say will answer the cause of your question… I’m guessing the question has been caused by slow site performance issues, right? If so, here you go:

    Your biggest problem here is almost certainly the “tracked visitor stats etc” in the database – not the number of ID’s. Inserts on every pageload are really hard as writes are much heavier processes than reads – not to mention they cause table locking for their write duration. Even if the tracking table is it’s own optimized table, it will still be detrimental to site performance.

    This is one of the single biggest contributors to db load at scale I’ve ever seen – and I’ve seen it a lot. Offload your visitor tracking functionality from your WP database, and you’ll find your site has a ton more headroom for performance.

    Good luck!

    • This reply was modified 1 month, 1 week ago by Rohjay. Reason: Clarity
    Thread Starter Stephen

    (@stephenhampton)

    Thanks everyone. These have all been fantastic, understandable answers (and a special thanks for not telling me I’m just being stupid).

    Thread Starter Stephen

    (@stephenhampton)

    @corrinarusso

    Loads of people use a WordPress + WooCommerce plugin for their online shop which I personally never recommend.

    We had quite a stiff discussion in the office overthe best solutions.
    The programmer wanted to write his own custom shop which seemed rediculous.
    The boss wanted WordPress + WooCommerce because their old shop was done that way and he had no problems.
    The social media guy wanted Shopify because it’s popular with his mates.
    I was on the fence preferring Prestashop because it’s like having a dedicated WooCommerce without the WordPress layer.

    The boss won, but I feel like it has ended up giving us the most problematic, vulnerable, high-maintenance, hosting critical, eCommerce solution of the bunch. (but to its credit, this is the most widely supported solution, espcially with third party companies like couriers)

    I know this is a WordPress forum, but I’m curious what platform you prefer. I come from a graphic design background, not a programming background so I’d love your technically-driven insight. (And Pleeeeeeeaaaaase dont say Magento – it was so difficult to set up that I had to hire programmers on Fivr just to install plugins)

    Moderator Steve Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Rep

    >> I know this is a WordPress forum, but I’m curious what platform you prefer <<

    This is no longer a support topic, but a topic for a blog post elsewhere.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘EVERYTHING gets a post ID. Isn’t there a better way?’ is closed to new replies.