jhvst / vertigo

Blog engine in Go (golang)
https://toldjuuso.github.io/vertigo
MIT License
264 stars 24 forks source link

Should ID be string or int? #36

Closed jhvst closed 9 years ago

jhvst commented 9 years ago

As mentioned in #1

Implementing a new driver will also open up questions, such as should the structure ID's on posts and uses be switched from int64 to GUID string. This is a tough choice, since changing it will break all current Vertigo installations, but I'm unsure whether NoSQL databases such as RethinkDB can be adjusted to work with incrementing primary key. Only time will tell.

I later asked about the matter from the the creator of Hugo. He said

strings are better for distributed databases

Therefore, I might be changing the structure system to support strings instead. This will be a major breaking change, but it will be a good base for an actual stable release. After this, I will consider the Vertigo's user and post API halted.

Anyhow, I'm opening this issue to ask for any opinions on this matter, should any of the contributors or users have any.

ghost commented 9 years ago

@9uuso I mean I've never used a string for an ID but it sounds interesting but also, if you were to do this would a new branch be created first?

jayrox commented 9 years ago

what benefit are you going for with changing from int to string?

jhvst commented 9 years ago

@jayrox To my knowledge it would be easier to add new database drivers if strings were used, but against my assumptions, the last 4 hours have proven that integer could be used with just a little bit of extra effort even with NoSQL databases.

I'll continue my research for few more hours, but now it looks like the integer will stay. I'll probably get the RethinkDB version pushed next week, which will show whether the integer ID will be a problem.

@netbun Well, yes, but that's nearly irrelevant because different features are not being developed at the same time. Most of the code is written by me and I tend to push forward one feature at a time.