Proper way to create schemas and send data to ThriftDB?

20 views
Skip to first unread message

Jonathan Rosen

unread,
Jul 26, 2012, 12:31:34 PM7/26/12
to thri...@googlegroups.com
I am new to Thrift, and after reading the Thrift docs, I'm still a little confused about how ThriftDB integrates with the Thrift Serialization protocol.

For example, what is the proper way to create a schema in ThriftDB? If I was using PHP, would I create an object, write a .thrift file for my object, and then autogenerate the schema? Or do I just create an object according to the schema specs, and then json encode it?

There isn't much in the way of explanation in the docs on how ThriftDB utilizes Thrift, and best practices for generating schemas. Also, should I utilize Thrift for sending data to ThriftDB, or use a tool like curl?

Thanks,

Jonathan

Andres Morey

unread,
Jul 26, 2012, 4:37:19 PM7/26/12
to thri...@googlegroups.com
Hi Jonathan,

ThriftDB uses Thrift behind the scenes so it's transparent to the user. All communication with ThriftDB is JSON over HTTP.

Have you had a chance to work through the example on the front page? The example schema is probably the best place to get started.

Andres

Jonathan Rosen

unread,
Jul 26, 2012, 8:13:26 PM7/26/12
to thri...@googlegroups.com
Yes, I made some progress today. It would also be helpful to describe the way to login to the API in the docs for private data stores. I figured it out, but I think one line in the docs for how to do this would be helpful just to make it more obvious.

I'm writing a php client library right now, and may create an iOS one also, if I decide to use ThriftDB for my project. I'll open source them once I have something working.

On another note, I am curious how you are storing quantity data, for example, in Octopart. For any given part, there is a many to one relationship between vendors and that product. What is the best way to store this relationship in ThriftDB, since there is no relational model?
Reply all
Reply to author
Forward
0 new messages