The API Dev Blog Trilogy - Volume Two - The types they are a 'changing (Tyrannis 1.2)

'Sup gang!

In Tyrannis 1.2 we'll be doing some major architectural changes to the EVE Database which could break your applications that use the EVE API or Static Data Export (SDE - or as some refer to it SDD). These changes were necessary in order to future-proof EVE Online, and it was impossible to get them done without directly affecting the API and SDE.

What is the tl;dr?

  • Most itemIDs are now 64-bit integers instead of 32-bit.
    • This includes locations but excludes owners.
  • All item typeIDs are now 32-bit integers instead of 16-bit.
  • All item flagIDs are now 16-bit integers instead of 8-bit.

Why are you doing this to me?

As mentioned above this is all done to future-proof EVE Online for all the incoming awesomeness that our (quite possibly insane) ambitions have always aimed for: "The ultimate Sci-Fi Simulator". One often mentioned pivotal point for us to reach this goal is the coming of Incarna and its vibrant station environments, vital to lend further immersion to the universe. The upcoming DUST 514, both a shooter and console MMO, will introduce a new type of character into New Eden's single universe, exponentially adding to the depth of the world, its lore and it's components.  This can't happen without increasing the number of available unique item IDs in the universe to account for these two new aspects of EVE and all they'll bring. EVE would then cease to be the ever-evolving organism it is today and stagnate. Nobody likes stagnation!

Furthermore, this refactoring work on our end was absolutely necessary for our beloved EVE Online as we know her today. For years now we've been teetering on the brink of running out of unique IDs and it has put quite a lot of stress on the maintenance required from our Operations department as well as development constraints on new features. It was a lot of work, with a lot of internal fallout but it puts us in a comfortable place regarding the future. We also used the opportunity to refactor other things in the code that we touched upon, so all in all the DB just looks better for it. For example, the available space constraints required for the data migration pushed us to find lots and lots of redundant data we could drop to free up space. Refactoring is pretty useful!

How will this affect the API pages?

To put it succinctly: It will possibly return wider data types. How this affects you is very application-specific.

In the case of characterIDs, allianceIDs and corporationIDs nothing will change as those are ownerIDs and we'll ensure they are always in the 32-bit range. Any item's typeID will now have to be handled as integer (32 bit, as opposed to previously 16-bit smallint) although old typeIDs will not change. The flagID of assets will similarly change from 8-bit tinyint to 16-bit smallint.

For items (locations are items, so are owners but we covered them already) I recommend using 64-bit integers indiscriminately. In certain situations you can be certain of itemIDs being in the 32-bit range, NPC Stations for example, but there's no real gain in writing specialized methods to handle those things just because you can, compared to the possible fallout and extra work.

How will this affect the Static Data Export?

The SDE is a lot simpler than the API changes. As all the data in it is static and authored by CCP we can promise you that the itemIDs and locationIDs will never go above the 32-bit range. Therefore this change only affects column referencing dbo.invTypes.typeID with a foreign key constraint and the dbo.invFlags table.

Note that not all columns named somethingTypeID represent an item's typeID. For example the assemblyLineTypeID is referencing dbo.ramAssemblyLineTypes rather than dbo.invTypes.

Is that all the API changes we can expect?

Absolutely not! These are the only changes that will force some work on you in order to keep your current apps up to date. Look out for the incoming final volume of the API Dev Blog Trilogy in the near future. This will detail the new additions as well as updates that make everybody's life easier!

I will of course do my best to answer any and all questions about this data type change in the comment section for this blog.

Included in this dev blog, free of any additional charge, is the standardized look of disapproval for your copy/pasting needs: ಠ_ಠ

Best Regards,
CCP Prism X
EVE Online Database Developer and Acting API-Dude