[Glass] Gemstones bidirectional communications

James Foster Smalltalk at JGFoster.net
Mon Jan 7 12:30:10 PST 2019


HI Dario,

> On Jan 7, 2019, at 9:01 AM, Trussardi Dario Romano via Glass <glass at lists.gemtalksystems.com> wrote:
> 
> Ciao James,
> 
> 	thanks.
> 
>> Hi Dario,
>> 
>> There are several ways of doing this along a continuum of how much both sides know that GemStone is at the other end. At one extreme, you could have each system export and import “flat” files (XML, JSON, STON,  CSV, tab-delimited, etc.). This is how we had disparate systems talk to each other in the 1980s. It is simple, reliable, and pretty easy to debug.
>> 
>> Next, you could define a “wire protocol” and have the transfer take place over a socket. The protocol could be similar to the file format with the exchange happening more quickly, but it does require more “handshaking” and effort at synchronization (with file transfer the other application doesn’t have to be up for you to put a file in a shared directory).
>> 
>> And at the more GemStone-focused end you could use GsExternalSession to have a Gem on one system start a session on the other system. With this you can execute strings and get back strings (or more complex objects, but that would be a lot of work).
> 
> 	What do you mean for: 	but that would be a lot of work.
> 
> 	Can you give some consideration about it?

It is complicated to manage relationships between two object spaces when only “primitive” types (SmallIntegers, Booleans, and Characters) can be copied between the two spaces. To transfer anything more complex you need to convert the object to a set of primitive types, send it over the wire, and recreate it on the other side. For an object made up of simple types (numbers, dates, strings), it isn’t too difficult to create a copy of the object. But for objects that point to other objects, you face the question of how deep to go in the copy. Also you face the question of how do you manage modifications on one side or the other. Do they get automatically transmitted across or do you get just a one-time copy that remains static.

> 	Is there any example code in this regard?

Yes, see GBS (https://gemtalksystems.com/products/gbs-vw/ <https://gemtalksystems.com/products/gbs-vw/>). The main lesson to learn is that you don’t want to go there!

> 	From which version is this support active?
> 
> 	I have a Gemstone 3.1.0.6 system but it does not define the class GsExternalSession.
> 
> 	( The Gemstone 3.3.6 define it )

Sorry, I don’t have that information memorized. You could search through the release notes or do a binary search between the two versions.

> 	The two systems must be of the same version?

I believe that, for all practical purposes, it is necessary. 

James

> 
>> 
>> The main thing to keep in mind with any of these approaches is that you are managing the relationship, not GemStone. There is no “transparent replication," object identity is not preserved, and relying on an OOP could be a problem if an object gets garbage-collected and the OOP reused.
> 
> 
> 
>> If one system is collecting new data and dumping it into another system, then this model can work pretty well, but you should think about long-running transactions (commit record backlog) for any idle sessions.
> 
> 	It is not clear to me what you mean.
> 
> 	Can you explain this last point better?	

See the videos at https://programminggems.wordpress.com/2010/02/05/scaling-objects-videos/ <https://programminggems.wordpress.com/2010/02/05/scaling-objects-videos/>, especially 12-15.

> 
> 	Thanks,
> 
> 		Dario
> 
>> James
>> 
>>> On Jan 4, 2019, at 9:06 AM, Trussardi Dario Romano via Glass <glass at lists.gemtalksystems.com> wrote:
>>> 
>>> Ciao,
>>> 
>>> 	to manage the problematic application on which i am working
>>> 	
>>> 	i would need to have two distinct environments that communicate with each other.
>>> 
>>> 	Where for environment i mean a Gemstone database.
>>> 
>>> 
>>> 	The first one should handle local management (i call it local-database) and is active on a local server (where the event happens).
>>> 
>>> 
>>> 	The second (i call it the internet-database) should manage support for users' smartphones and send summary data to the local-database.
>>> 
>>> 	Internet-database is active on a server in remote datacenter.
>>> 
>>> 	In this way users (hundreds) with their devices go to load the Internet-database not interfering with local-database management.
>>> 
>>> 
>>> 
>>> 	Now my question is about how i can handle bidirectional communication between the two Gemstone database servers (running a VPN)
>>> 
>>> 	
>>> 	Thanks for considerations,
>>> 
>>> 		Dario
>>> 
>>> 	P.S. Have I been sufficiently clear?
>>> _______________________________________________
>>> Glass mailing list
>>> Glass at lists.gemtalksystems.com
>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>> 
> 
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com <mailto:Glass at lists.gemtalksystems.com>
> http://lists.gemtalksystems.com/mailman/listinfo/glass <http://lists.gemtalksystems.com/mailman/listinfo/glass>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20190107/ea4db334/attachment-0001.html>


More information about the Glass mailing list